From patchwork Tue Nov 6 23:02:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 993978 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42qQ9V5myxz9sCQ for ; Wed, 7 Nov 2018 10:04:46 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 54812C2293F; Tue, 6 Nov 2018 23:03:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 0480FC2295D; Tue, 6 Nov 2018 23:03:24 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 376E8C2295D; Tue, 6 Nov 2018 23:02:21 +0000 (UTC) Received: from mail-qt1-f201.google.com (mail-qt1-f201.google.com [209.85.160.201]) by lists.denx.de (Postfix) with ESMTPS id 82683C22961 for ; Tue, 6 Nov 2018 23:02:21 +0000 (UTC) Received: by mail-qt1-f201.google.com with SMTP id j63-v6so4541781qte.13 for ; Tue, 06 Nov 2018 15:02:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=AvkC1Jep7PwJiwjC/Nqhoq3WsYNASEPRRgcpZwMj8pU=; b=ARYE10IsQeiN55P/qfekaEiHLX32wyv+rvOzSWKgi8Z820Lch6suwD1ADR/P/K5zRH aNB4bPjo5qnlEzSG8fBxYNxwSAEsJFW1hghTvWR6YdEH1ZSz8Giyc71cdPynBxv+cbLk POQfyq7Wt5x9q9CV5yEuzEum9S6+klDm4SwAZqj6ViMtQd6ScPtdFwNBbh4npSKe27gH 3K76GNK73Gxg2tf1j+b0BmtExCcP0N4D2yw4rv+hHnQA3sOHzhF/cWWS4jogourcy7lk UiNOOQp7dZJkLSHzWKgV428Rh8OphY3vR/ZYUCYUFq8jv0vj8HnjJyYP+FljjqW6f3Gc f9UA== X-Gm-Message-State: AGRZ1gIbiIJHCoOgxiFVHFsm9VwIaWeoQ78rxpuOUcF5FJGHVG5uW29D +yfB88Chf20JOLiJmTinJkJ/iHM= X-Google-Smtp-Source: AJdET5eV5iB5NTcot/NriLbtT9R1JJlqsfCFX5aKsUo0x/a+dhUgcLu9X7a/bNpZKozaGHAgpe8q4js= X-Received: by 2002:a0c:d84d:: with SMTP id i13mr21086234qvj.26.1541545340507; Tue, 06 Nov 2018 15:02:20 -0800 (PST) Date: Tue, 6 Nov 2018 16:02:13 -0700 In-Reply-To: <20181106230213.144851-1-sjg@chromium.org> Message-Id: <20181106230213.144851-4-sjg@chromium.org> Mime-Version: 1.0 References: <20181106230213.144851-1-sjg@chromium.org> X-Mailer: git-send-email 2.19.1.930.g4563a0d9d0-goog From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini Subject: [U-Boot] [PATCH 4/4] buildman: Show boards with warning with w+ X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" At present we should boards with warnings in the same way as those with errors. This is not ideal. Add a new 'warn' state and show these listed in yellow to match the actual warning lines printing with -e. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/buildman/builder.py | 17 +++++++++--- tools/buildman/test.py | 56 ++++++++++++++++++++++++++++----------- 2 files changed, 54 insertions(+), 19 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index d9d86ef6a39..6a6c83bf336 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -1197,6 +1197,7 @@ class Builder: ok_boards = [] # List of boards fixed since last commit + warn_boards = [] # List of boards with warnings since last commit err_boards = [] # List of new broken boards since last commit new_boards = [] # List of boards that didn't exist last time unknown_boards = [] # List of boards that were not built @@ -1212,9 +1213,15 @@ class Builder: if outcome.rc == OUTCOME_UNKNOWN: unknown_boards.append(target) elif outcome.rc < base_outcome: - ok_boards.append(target) + if outcome.rc == OUTCOME_WARNING: + warn_boards.append(target) + else: + ok_boards.append(target) elif outcome.rc > base_outcome: - err_boards.append(target) + if outcome.rc == OUTCOME_WARNING: + warn_boards.append(target) + else: + err_boards.append(target) else: new_boards.append(target) @@ -1225,11 +1232,13 @@ class Builder: self._base_warn_line_boards, warn_lines, warn_line_boards, 'w') # Display results by arch - if any((ok_boards, err_boards, unknown_boards, new_boards, worse_err, - better_err, worse_warn, better_warn)): + if any((ok_boards, warn_boards, err_boards, unknown_boards, new_boards, + worse_err, better_err, worse_warn, better_warn)): arch_list = {} self.AddOutcome(board_selected, arch_list, ok_boards, '', self.col.GREEN) + self.AddOutcome(board_selected, arch_list, warn_boards, 'w+', + self.col.YELLOW) self.AddOutcome(board_selected, arch_list, err_boards, '+', self.col.RED) self.AddOutcome(board_selected, arch_list, new_boards, '*', self.col.BLUE) diff --git a/tools/buildman/test.py b/tools/buildman/test.py index 90ab35b1664..4ceb4cceb5a 100644 --- a/tools/buildman/test.py +++ b/tools/buildman/test.py @@ -97,6 +97,8 @@ boards = [ BASE_DIR = 'base' +OUTCOME_OK, OUTCOME_WARN, OUTCOME_ERR = range(3) + class Options: """Class that holds build options""" pass @@ -166,9 +168,10 @@ class TestBuild(unittest.TestCase): result.combined = result.stdout + result.stderr return result - def assertSummary(self, text, arch, plus, boards, ok=False): + def assertSummary(self, text, arch, plus, boards, outcome=OUTCOME_ERR): col = self._col - expected_colour = col.GREEN if ok else col.RED + expected_colour = (col.GREEN if outcome == OUTCOME_OK else + col.YELLOW if outcome == OUTCOME_WARN else col.RED) expect = '%10s: ' % arch # TODO(sjg@chromium.org): If plus is '', we shouldn't need this expect += ' ' + col.Color(expected_colour, plus) @@ -192,6 +195,8 @@ class TestBuild(unittest.TestCase): build.do_make = self.Make board_selected = self.boards.GetSelectedDict() + # Build the boards for the pre-defined commits and warnings/errors + # associated with each. This calls our Make() to inject the fake output. build.BuildBoards(self.commits, board_selected, keep_outputs=False, verbose=False) lines = terminal.GetPrintTestLines() @@ -207,33 +212,49 @@ class TestBuild(unittest.TestCase): build.ShowSummary(self.commits, board_selected) #terminal.EchoPrintTestLines() lines = terminal.GetPrintTestLines() + + # Upstream commit: no errors self.assertEqual(lines[0].text, '01: %s' % commits[0][1]) + + # Second commit: all archs should fail with warnings self.assertEqual(lines[1].text, '02: %s' % commits[1][1]) - # We expect all archs to fail col = terminal.Color() - self.assertSummary(lines[2].text, 'sandbox', '+', ['board4']) - self.assertSummary(lines[3].text, 'arm', '+', ['board1']) - self.assertSummary(lines[4].text, 'powerpc', '+', ['board2', 'board3']) - - # Now we should have the compiler warning + self.assertSummary(lines[2].text, 'sandbox', 'w+', ['board4'], + outcome=OUTCOME_WARN) + self.assertSummary(lines[3].text, 'arm', 'w+', ['board1'], + outcome=OUTCOME_WARN) + self.assertSummary(lines[4].text, 'powerpc', 'w+', ['board2', 'board3'], + outcome=OUTCOME_WARN) + + # Second commit: The warnings should be listed self.assertEqual(lines[5].text, 'w+%s' % errors[0].rstrip().replace('\n', '\nw+')) self.assertEqual(lines[5].colour, col.MAGENTA) + # Third commit: Still fails self.assertEqual(lines[6].text, '03: %s' % commits[2][1]) self.assertSummary(lines[7].text, 'sandbox', '+', ['board4']) - self.assertSummary(lines[8].text, 'arm', '', ['board1'], ok=True) + self.assertSummary(lines[8].text, 'arm', '', ['board1'], + outcome=OUTCOME_OK) self.assertSummary(lines[9].text, 'powerpc', '+', ['board2', 'board3']) - # Compiler error + # Expect a compiler error self.assertEqual(lines[10].text, '+%s' % errors[1].rstrip().replace('\n', '\n+')) + # Fourth commit: Compile errors are fixed, just have warning for board3 self.assertEqual(lines[11].text, '04: %s' % commits[3][1]) - self.assertSummary(lines[12].text, 'sandbox', '', ['board4'], ok=True) - self.assertSummary(lines[13].text, 'powerpc', '', ['board2', 'board3'], - ok=True) + self.assertSummary(lines[12].text, 'sandbox', 'w+', ['board4'], + outcome=OUTCOME_WARN) + expect = '%10s: ' % 'powerpc' + expect += ' ' + col.Color(col.GREEN, '') + expect += ' ' + expect += col.Color(col.GREEN, ' %s' % 'board2') + expect += ' ' + col.Color(col.YELLOW, 'w+') + expect += ' ' + expect += col.Color(col.YELLOW, ' %s' % 'board3') + self.assertEqual(lines[13].text, expect) # Compile error fixed self.assertEqual(lines[14].text, '-%s' % @@ -244,9 +265,11 @@ class TestBuild(unittest.TestCase): errors[2].rstrip().replace('\n', '\nw+')) self.assertEqual(lines[15].colour, col.MAGENTA) + # Fifth commit self.assertEqual(lines[16].text, '05: %s' % commits[4][1]) self.assertSummary(lines[17].text, 'sandbox', '+', ['board4']) - self.assertSummary(lines[18].text, 'powerpc', '', ['board3'], ok=True) + self.assertSummary(lines[18].text, 'powerpc', '', ['board3'], + outcome=OUTCOME_OK) # The second line of errors[3] is a duplicate, so buildman will drop it expect = errors[3].rstrip().split('\n') @@ -257,8 +280,10 @@ class TestBuild(unittest.TestCase): self.assertEqual(lines[20].text, 'w-%s' % errors[2].rstrip().replace('\n', '\nw-')) + # Sixth commit self.assertEqual(lines[21].text, '06: %s' % commits[5][1]) - self.assertSummary(lines[22].text, 'sandbox', '', ['board4'], ok=True) + self.assertSummary(lines[22].text, 'sandbox', '', ['board4'], + outcome=OUTCOME_OK) # The second line of errors[3] is a duplicate, so buildman will drop it expect = errors[3].rstrip().split('\n') @@ -269,6 +294,7 @@ class TestBuild(unittest.TestCase): self.assertEqual(lines[24].text, 'w-%s' % errors[0].rstrip().replace('\n', '\nw-')) + # Seventh commit self.assertEqual(lines[25].text, '07: %s' % commits[6][1]) self.assertSummary(lines[26].text, 'sandbox', '+', ['board4'])