@@ -70,7 +70,10 @@ class PatchSeries:
# Parse each [tag] in the subject individually
tags = re.findall(r'\[([^\[\]]*)\]', self.patches[0].subject)
valid_branches = [t.strip() for t in tags if PatchSeries.valid_branch(t.strip())]
- return valid_branches[0] if valid_branches else None
+ if not valid_branches:
+ return None
+ # Strip trailing series position, e.g. "scarthgap 50/71" -> "scarthgap"
+ return re.sub(r'\s+\d+/\d+$', '', valid_branches[0])
@staticmethod
def valid_branch(branch):
@@ -89,7 +89,7 @@ class TestMbox(base.Base):
if failures:
self.fail(
'One or more patches in the series do not apply cleanly',
- data=[('Patch', subject) for subject, _ in failures],
+ data=[('Patch', subject) for subject, _ in failures] if len(results) > 1 else None,
)
def test_target_mailing_list(self):
@@ -90,8 +90,11 @@ def make_result_class(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"]
_emit('{}: {}: {} ({})'.format(self.fail, desc, issue, test.id()), logfile)
+ for key, val in parsed.get('data') or []:
+ _emit(' {}: {}'.format(key, val), logfile)
def addSuccess(self, test):
desc = _format_test_description(test)
There are two issues with how patchtest reports results for testing a patch series: 1. When a target branch mismatch is detected, it reports (for example) "scarthgap 50/71" as the target branch instead of just "scarthgap"; 2. It doesn't report the full shortlog for a commit which fails to apply, as expected. Fix both issues, but make sure that we only print shortlogs for patches which fail to apply if there's more than one actual commit being tested, as otherwise the patch failing to merge is obvious. AI-Generated: Uses Claude Code Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> --- meta/lib/patchtest/mbox.py | 5 ++++- meta/lib/patchtest/tests/test_mbox.py | 2 +- scripts/patchtest | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-)