Skip to content

Commit 61d337c

Browse files
rossburtonrpurdie
authored andcommitted
oeqa/logparser: ignore comments in the test log
Whilst the log format is normally pretty simple: PASS: foo SKIP: bar It's entirely possible for there to be an explanatory comment: SKIP: bar # only runs under Windows We currently use the entire string after the test state as the test name, which includes the comment. This can lead to long test names, for example: test_dtype.py:TestStructuredObjectRefcounting.test_structured_object_ create_delete[ones-1-<subarray>]_#_SKIP_Python_3.12_has_immortal_ refcounts,_this_test_will_no_longer_work._See_gh-23986 Whilst these test names are very long it isn't normally a problem, but some packages have non-deterministic skip messages: test_ufunc.py:TestUfunc.test_identityless_reduction_huge_array_#_ SKIP_6.442450944_GB_memory_required,_but_3.366531072_GB_available This leads to churn in the test reports. The comment isn't needed, so strip it out when computing the test name. Note that this will result in a number of tests disappearing in the test reports, with an identical number of new tests appearing. [1] https://www.gnu.org/software/automake/manual/automake.html#Scripts_002dbased-Testsuites-1 Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
1 parent d7c8cac commit 61d337c

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

meta/lib/oeqa/utils/logparser.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,18 @@ def newsection():
7777
for t in test_regex:
7878
result = test_regex[t].search(line)
7979
if result:
80+
section = result.group(1)
81+
# It's possible that the output contains a comment, eg:
82+
# SKIP: test_something # only needed for Windows
83+
# If there's a comment, remove it.
84+
if "#" in section:
85+
section = section.partition("#")[0]
86+
section = section.strip()
87+
8088
try:
81-
self.results[current_section['name']][result.group(1).strip()] = t
89+
self.results[current_section['name']][section] = t
8290
except KeyError:
83-
bb.warn("Result with no section: %s - %s" % (t, result.group(1).strip()))
91+
bb.warn("Result with no section: %s - %s" % (t, section))
8492

8593
# Python performance for repeatedly joining long strings is poor, do it all at once at the end.
8694
# For 2.1 million lines in a log this reduces 18 hours to 12s.

0 commit comments

Comments
 (0)