Bug 15575 - test_mbox.TestMbox.test_shortlog_length needs to exclude branch specifiers
Summary: test_mbox.TestMbox.test_shortlog_length needs to exclude branch specifiers
Status: RESOLVED FIXED
Alias: None
Product: Patchwork/Patchtest
Classification: Yocto Project Subprojects
Component: Patchtest (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium normal
Target Milestone: 5.1
Assignee: Trevor Gamblin
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2024-08-08 18:15 UTC by Ryan Eatmon
Modified: 2024-09-03 13:24 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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