diff options
author | Trevor Gamblin <tgamblin@baylibre.com> | 2024-08-30 21:39:03 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-09-01 12:28:10 +0100 |
commit | 3802372a2a4ffdb0b56475c13229a43ae1c56703 (patch) | |
tree | 735fd7210ba1448c206d2f7a76b3e37af21a12f0 /meta/lib/patchtest/tests/test_mbox.py | |
parent | 6f66cf76941832fa3a7bfef4364ca385fdea6826 (diff) | |
download | poky-3802372a2a4ffdb0b56475c13229a43ae1c56703.tar.gz |
patchtest: test_shortlog_length: omit shortlog prefixes
In certain cases, the shortlog for a patch would include branch and
'PATCH' tag information even after the repo tag got stripped out,
padding it with data that wouldn't actually be included with a merge.
This caused the patchtest test_shortlog_length test to erroneously
report a failure.
For example, a patch whose shortlog tags were:
[OE-core][master/scarthgap][PATCH]
would leave this behind in the shortlog, along with the actual content:
[master/scarthgap][PATCH]
Add a re.sub() call in the test to fix this by removing all square
bracket pairs that appear at the beginning of the string.
Fixes [YOCTO #15575].
(From OE-Core rev: 6e1ddadfe779291cf46fb88fb01769c022b733ac)
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/patchtest/tests/test_mbox.py')
-rw-r--r-- | meta/lib/patchtest/tests/test_mbox.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/lib/patchtest/tests/test_mbox.py b/meta/lib/patchtest/tests/test_mbox.py index ae16c4bf93..0e3d055780 100644 --- a/meta/lib/patchtest/tests/test_mbox.py +++ b/meta/lib/patchtest/tests/test_mbox.py | |||
@@ -9,6 +9,7 @@ import collections | |||
9 | import parse_shortlog | 9 | import parse_shortlog |
10 | import parse_signed_off_by | 10 | import parse_signed_off_by |
11 | import pyparsing | 11 | import pyparsing |
12 | import re | ||
12 | import subprocess | 13 | import subprocess |
13 | from data import PatchTestInput | 14 | from data import PatchTestInput |
14 | 15 | ||
@@ -82,7 +83,7 @@ class TestMbox(base.Base): | |||
82 | def test_shortlog_length(self): | 83 | def test_shortlog_length(self): |
83 | for commit in TestMbox.commits: | 84 | for commit in TestMbox.commits: |
84 | # no reason to re-check on revert shortlogs | 85 | # no reason to re-check on revert shortlogs |
85 | shortlog = commit.shortlog | 86 | shortlog = re.sub('^(\[.*?\])+ ', '', commit.shortlog) |
86 | if shortlog.startswith('Revert "'): | 87 | if shortlog.startswith('Revert "'): |
87 | continue | 88 | continue |
88 | l = len(shortlog) | 89 | l = len(shortlog) |