From patchwork Sat Jan 10 20:08:08 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1433 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768075752; bh=kctX+YGhzM9d9TpV7dbs8UXw3snaMZawpGJiYzirIps=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=gUwrXxxNlat1x+aT/IzkoApVHEeqdfuuqRvC5GKJ80SEnT8wiS7fwCnENPLjmrzBZ M22gwlEDf8ZCZvG8bA/8OdtW+flBAXyFufRRlLCFyD0GaXsY8olBJu2n2qEdJPQiw2 cfJ0LtKlQnePtDM5b2LiszyZRKsLL4YBoYK4ow+H0kIVy/l4giN7y3vOgGJOTD5sI5 sEIY9AABcnrSMMXkLFQpO7xkw2MpGaK9Z7smVgv0xDmoD0ChtJdKgtl2cNIS7MMh55 YN7B/kUXYLrIoszv4mN3gXno83J2W+OKwnh5mlYJfld5LBcR+WpyJYoMa1M11Ywudo x30tfJUEobbKg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 629F369281 for ; Sat, 10 Jan 2026 13:09:12 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 8RbbfPYV4Acl for ; Sat, 10 Jan 2026 13:09:12 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768075752; bh=kctX+YGhzM9d9TpV7dbs8UXw3snaMZawpGJiYzirIps=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=gUwrXxxNlat1x+aT/IzkoApVHEeqdfuuqRvC5GKJ80SEnT8wiS7fwCnENPLjmrzBZ M22gwlEDf8ZCZvG8bA/8OdtW+flBAXyFufRRlLCFyD0GaXsY8olBJu2n2qEdJPQiw2 cfJ0LtKlQnePtDM5b2LiszyZRKsLL4YBoYK4ow+H0kIVy/l4giN7y3vOgGJOTD5sI5 sEIY9AABcnrSMMXkLFQpO7xkw2MpGaK9Z7smVgv0xDmoD0ChtJdKgtl2cNIS7MMh55 YN7B/kUXYLrIoszv4mN3gXno83J2W+OKwnh5mlYJfld5LBcR+WpyJYoMa1M11Ywudo x30tfJUEobbKg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4B55A69275 for ; Sat, 10 Jan 2026 13:09:12 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768075750; bh=IEhoem5f7Bp0Fi4ZhuBlDC2ahytxdO0m5Z8YYlgNGsw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E8+x5aN8nnlI4LpjcAYDkv0/RB3C5GgIlxSHmpuNbGtaYTITCSMXnkdCS5lSE36VH Jwowgnij0ZYpEdXpbQVD1zKydr/Sg2fdp1JNaxsuF50FDRIApHZN+76lDC1iO/kg0K oqM357b/J+DAy41h24/e7lI5NKeh1tAmJDe7b4JC93zbOPvIUcUhp9GSTbp09wgsSr bZ8X7xJcn4YhVi8gB1bWbcr3iVnhyi+Yye2gU/rX4IgA0nyGRBxtTeL+u+nFb3SW8S OvmHj7kFITm/L5nz5EQEmv45ibiRQjZYIy3MPSpRK3umo1UalNV94TPHOnUpZU7W/8 XTsCUCv6PMTog== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 54B0869275; Sat, 10 Jan 2026 13:09:10 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id FKjUPFzUFrS3; Sat, 10 Jan 2026 13:09:10 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768075745; bh=PXeoJa6W6h9t7Yz2MGTB0QI4DAw1O4am+1Gp8kihAjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AKo4DKWJuv6eQHhzlOENW9ePqZLqAQ1yVywsAlp/+B3dUQpUfRD8ZnzvoSE/P+WPo irZuF1dzzKd9POw6W+04RlwC8Q6Lxe+q7PftupxtqHYg23+9ytLGTNR3HKxdtlQev2 HB4F2hsIxWsbk4bxbpMDApzgvPtq5ToDhOMKybOVDL+m9eUBIrEiahpYA784Y8dGgC EwDyQ69H94/1fb/N1C/MAGMYgh1DUm8nw124XjSMHCA9iZj/9Wov8uwcmCA3h5HCV1 /k8ELwSal4iAhHedfFTObuVa+G63M+0yH/hCwfYgIS08+DZoOFXLH7YYyjx4pma2Ae uBWLG6xPeAOMQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 783F369221; Sat, 10 Jan 2026 13:09:05 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 10 Jan 2026 13:08:08 -0700 Message-ID: <20260110200828.168672-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260110200828.168672-1-sjg@u-boot.org> References: <20260110200828.168672-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 4HEJTPO3DQWGMQ7NMXRRWNPBV3I3HYKN X-Message-ID-Hash: 4HEJTPO3DQWGMQ7NMXRRWNPBV3I3HYKN X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 05/18] buildman: Move OUTCOME_* constants to outcome module List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move the OUTCOME_OK, OUTCOME_WARNING, OUTCOME_ERROR, and OUTCOME_UNKNOWN constants from builder.py to outcome.py alongside the Outcome class. Update builder.py and test_builder.py to import from the new location. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/builder.py | 6 ++---- tools/buildman/outcome.py | 5 ++++- tools/buildman/test_builder.py | 32 +++++++++++++++++++------------- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 94552bf62ca..96976f513e8 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -21,7 +21,8 @@ import threading from buildman import builderthread from buildman.cfgutil import Config, process_config -from buildman.outcome import Outcome +from buildman.outcome import (Outcome, OUTCOME_OK, OUTCOME_WARNING, + OUTCOME_ERROR, OUTCOME_UNKNOWN) from u_boot_pylib import command from u_boot_pylib import gitutil from u_boot_pylib import terminal @@ -135,9 +136,6 @@ ErrLine = collections.namedtuple('ErrLine', 'char,brds,errline') # unknown: List of boards that were not built BoardStatus = collections.namedtuple('BoardStatus', 'ok,warn,err,new,unknown') -# Possible build outcomes -OUTCOME_OK, OUTCOME_WARNING, OUTCOME_ERROR, OUTCOME_UNKNOWN = list(range(4)) - # Translate a commit subject into a valid filename (and handle unicode) trans_valid_chars = str.maketrans('/: ', '---') diff --git a/tools/buildman/outcome.py b/tools/buildman/outcome.py index 4f8bc9a0bae..373740cd94b 100644 --- a/tools/buildman/outcome.py +++ b/tools/buildman/outcome.py @@ -1,7 +1,10 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2013 The Chromium OS Authors. -"""Outcome class for buildman build results""" +"""Outcome class and constants for buildman build results""" + +# Build-outcome codes +OUTCOME_OK, OUTCOME_WARNING, OUTCOME_ERROR, OUTCOME_UNKNOWN = list(range(4)) class Outcome: diff --git a/tools/buildman/test_builder.py b/tools/buildman/test_builder.py index fd60767bca0..b92e0be18be 100644 --- a/tools/buildman/test_builder.py +++ b/tools/buildman/test_builder.py @@ -12,6 +12,8 @@ from unittest import mock from buildman import builder from buildman import builderthread +from buildman.outcome import (OUTCOME_OK, OUTCOME_WARNING, OUTCOME_ERROR, + OUTCOME_UNKNOWN) from u_boot_pylib import gitutil from u_boot_pylib import terminal @@ -358,12 +360,16 @@ class TestShowNotBuilt(unittest.TestCase): outcome.err_lines = err_lines if err_lines else [] return outcome + def _show_not_built(self, board_selected, board_dict): + """Helper to call Builder._show_not_built""" + builder.Builder._show_not_built(board_selected, board_dict) + def test_all_boards_built(self): """Test when all selected boards were built successfully""" board_selected = {'board1': None, 'board2': None} board_dict = { - 'board1': self._make_outcome(builder.OUTCOME_OK), - 'board2': self._make_outcome(builder.OUTCOME_OK), + 'board1': self._make_outcome(OUTCOME_OK), + 'board2': self._make_outcome(OUTCOME_OK), } terminal.get_print_test_lines() # Clear @@ -377,9 +383,9 @@ class TestShowNotBuilt(unittest.TestCase): """Test when some boards have OUTCOME_UNKNOWN (e.g. missing toolchain)""" board_selected = {'board1': None, 'board2': None, 'board3': None} board_dict = { - 'board1': self._make_outcome(builder.OUTCOME_OK), - 'board2': self._make_outcome(builder.OUTCOME_UNKNOWN), - 'board3': self._make_outcome(builder.OUTCOME_UNKNOWN), + 'board1': self._make_outcome(OUTCOME_OK), + 'board2': self._make_outcome(OUTCOME_UNKNOWN), + 'board3': self._make_outcome(OUTCOME_UNKNOWN), } terminal.get_print_test_lines() # Clear @@ -396,8 +402,8 @@ class TestShowNotBuilt(unittest.TestCase): """Test when all boards have OUTCOME_UNKNOWN""" board_selected = {'board1': None, 'board2': None} board_dict = { - 'board1': self._make_outcome(builder.OUTCOME_UNKNOWN), - 'board2': self._make_outcome(builder.OUTCOME_UNKNOWN), + 'board1': self._make_outcome(OUTCOME_UNKNOWN), + 'board2': self._make_outcome(OUTCOME_UNKNOWN), } terminal.get_print_test_lines() # Clear @@ -413,8 +419,8 @@ class TestShowNotBuilt(unittest.TestCase): """Test that build errors (not toolchain) are not counted as 'not built'""" board_selected = {'board1': None, 'board2': None} board_dict = { - 'board1': self._make_outcome(builder.OUTCOME_OK), - 'board2': self._make_outcome(builder.OUTCOME_ERROR, + 'board1': self._make_outcome(OUTCOME_OK), + 'board2': self._make_outcome(OUTCOME_ERROR, ['error: some build error']), } @@ -429,10 +435,10 @@ class TestShowNotBuilt(unittest.TestCase): """Test that toolchain errors are counted as 'not built'""" board_selected = {'board1': None, 'board2': None, 'board3': None} board_dict = { - 'board1': self._make_outcome(builder.OUTCOME_OK), - 'board2': self._make_outcome(builder.OUTCOME_ERROR, + 'board1': self._make_outcome(OUTCOME_OK), + 'board2': self._make_outcome(OUTCOME_ERROR, ['Tool chain error for arm: not found']), - 'board3': self._make_outcome(builder.OUTCOME_ERROR, + 'board3': self._make_outcome(OUTCOME_ERROR, ['error: some build error']), } @@ -451,7 +457,7 @@ class TestShowNotBuilt(unittest.TestCase): """Test that boards missing from board_dict are counted as 'not built'""" board_selected = {'board1': None, 'board2': None, 'board3': None} board_dict = { - 'board1': self._make_outcome(builder.OUTCOME_OK), + 'board1': self._make_outcome(OUTCOME_OK), # board2 and board3 are not in board_dict }