diff mbox series

[1/6] scripts/patchtest: print failure data with results

Message ID 20261204174107.1295971-2-tgamblin@baylibre.com
State New
Headers show
Series patchtest: script fixes, improve recipe parsing | expand

Commit Message

Trevor Gamblin Dec. 4, 2026, 5:41 p.m. UTC
Print the data passed with each failure, such as the suggested mailing
list from test_target_mailing_list, along with the test result.
addFailure() adds ': ' after each key, so drop the trailing colon from
the "Patch's path" key in test_mbox.py to avoid doubling it.

AI-Generated: Uses Claude Code Opus 5.5

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
---
 meta/lib/patchtest/tests/test_mbox.py | 4 ++--
 scripts/patchtest                     | 5 ++++-
 2 files changed, 6 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/meta/lib/patchtest/tests/test_mbox.py b/meta/lib/patchtest/tests/test_mbox.py
index 3db21d2104..0660e7aced 100644
--- a/meta/lib/patchtest/tests/test_mbox.py
+++ b/meta/lib/patchtest/tests/test_mbox.py
@@ -123,14 +123,14 @@  class TestMbox(base.Base):
                 if base_path in project.paths:
                     self.fail('Series sent to the wrong mailing list or some patches from the series correspond to different mailing lists',
                               data=[('Suggested ML', '%s [%s]' % (project.listemail, project.gitrepo)),
-                                    ('Patch\'s path:', patch.path)])
+                                    ('Patch\'s path', patch.path)])
 
             # check for poky's scripts code
             if base_path.startswith('scripts'):
                 for poky_file in self.poky_scripts:
                     if patch.path.startswith(poky_file):
                         self.fail('Series sent to the wrong mailing list or some patches from the series correspond to different mailing lists',
-                                  data=[('Suggested ML', '%s [%s]' % (self.poky.listemail, self.poky.gitrepo)),('Patch\'s path:', patch.path)])
+                                  data=[('Suggested ML', '%s [%s]' % (self.poky.listemail, self.poky.gitrepo)),('Patch\'s path', patch.path)])
 
     def test_mbox_format(self):
         if self.unidiff_parse_error:
diff --git a/scripts/patchtest b/scripts/patchtest
index 17a3cebb48..86271a40c1 100755
--- a/scripts/patchtest
+++ b/scripts/patchtest
@@ -89,8 +89,11 @@  def getResult(patch, mergepatch, logfile=None):
         def addFailure(self, test, err):
             self.test_failure = True
             desc = _format_test_description(test)
-            issue = json.loads(str(err[1]))["issue"]
+            parsed = json.loads(str(err[1]))
+            issue = parsed["issue"]
             _write_patchtest_result('{}: {}: {} ({})'.format(self.fail, desc, issue, test.id()), logfile)
+            for key, val in parsed.get('data') or []:
+                _write_patchtest_result('    {}: {}'.format(key, val), logfile)
 
         def addSuccess(self, test):
             desc = _format_test_description(test)