Bug 15575

Summary: test_mbox.TestMbox.test_shortlog_length needs to exclude branch specifiers
Product: [Yocto Project Subprojects] Patchwork/Patchtest Reporter: Ryan Eatmon <reatmon>
Component: PatchtestAssignee: Trevor Gamblin <tgamblin>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: randy.macleod, reatmon, richard.purdie
Version: unspecified   
Target Milestone: 5.1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ryan Eatmon 2024-08-08 18:15:45 UTC
The test_mbox.TestMbox.test_shortlog_length check is not excluding the [master] or [master/scarthgap] branch specifier in the subject.  For example:

[OE-core][master/scarthgap][PATCH] u-boot.inc: Refactor do_* steps into functions that can be overridden

Resulted in the failure:

FAIL: test shortlog length: Edit shortlog so that it is 90 characters or less (currently 95 characters) (test_mbox.TestMbox.test_shortlog_length)


But the same shortlog without the specifier passed.
Comment 1 Richard Purdie 2024-08-15 14:31:39 UTC
Anything in [] will not make the commit message so the test should probably exclude anything enclosed in those.
Comment 2 Trevor Gamblin 2024-08-31 01:27:31 UTC
This is a little strange. I've got a local copy of that patch and I'm testing it with patchtest locally. That subject line is actually 104 characters, so not sure why it's counting 95. Coincidentally, removing "scarthgap" from it brings the count to 95, so maybe it's reading it with that stripped.

When I try locally, with prints added:

|SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
|PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
|shortlog is [master/scarthgap][PATCH] u-boot.inc: Refactor do_* steps into functions that can be overridden
|shortlog len is 95
|FAIL: test shortlog length: Edit shortlog so that it is 90 characters or less (currently 95 characters) (test_mbox.TestMbox.test_shortlog_length)

So the "[OE-core]" is getting stripped, but the branch and PATCH tags aren't.

A re.sub() call should fix this.
Comment 3 Trevor Gamblin 2024-08-31 13:25:14 UTC
Patch up for review: https://lists.openembedded.org/g/openembedded-core/message/203972