diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-04-28 17:51:00 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-05-03 07:33:18 +0100 |
commit | 5caf9e375fcb9793e50772e590de1e137d3887f9 (patch) | |
tree | 1d2d16963ad63ee796d0656f77b5f189ebe9957b /meta/lib/oeqa/runtime | |
parent | 9ca04fc169d512579238fff4ba337dcc23e42af4 (diff) | |
download | poky-5caf9e375fcb9793e50772e590de1e137d3887f9.tar.gz |
oeqa/runtime/ptest: Make returning no test results a failure
Ensure that even if a ptests results section is empty, the log parser adds that
empty section. Then ensure that empty sections trigger warnings.
This means if a ptest suddently stops returning any results, we notice and see
warnings about it. This has gone unnoticed on the autobuilder far too many times
so is very much worth highlighting as a regression. We shouldn't have empty ptests.
(From OE-Core rev: 5ad0cf57b41ec7f44647a03bc568d0b24906cc8d)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/runtime')
-rw-r--r-- | meta/lib/oeqa/runtime/cases/ptest.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/meta/lib/oeqa/runtime/cases/ptest.py b/meta/lib/oeqa/runtime/cases/ptest.py index 3ef9022188..23a71ea064 100644 --- a/meta/lib/oeqa/runtime/cases/ptest.py +++ b/meta/lib/oeqa/runtime/cases/ptest.py | |||
@@ -83,12 +83,15 @@ class PtestRunnerTest(OERuntimeTestCase): | |||
83 | 83 | ||
84 | extras['ptestresult.sections'] = sections | 84 | extras['ptestresult.sections'] = sections |
85 | 85 | ||
86 | zerolength = [] | ||
86 | trans = str.maketrans("()", "__") | 87 | trans = str.maketrans("()", "__") |
87 | for section in results: | 88 | for section in results: |
88 | for test in results[section]: | 89 | for test in results[section]: |
89 | result = results[section][test] | 90 | result = results[section][test] |
90 | testname = "ptestresult." + (section or "No-section") + "." + "_".join(test.translate(trans).split()) | 91 | testname = "ptestresult." + (section or "No-section") + "." + "_".join(test.translate(trans).split()) |
91 | extras[testname] = {'status': result} | 92 | extras[testname] = {'status': result} |
93 | if not results[section]: | ||
94 | zerolength.append(section) | ||
92 | 95 | ||
93 | failed_tests = {} | 96 | failed_tests = {} |
94 | 97 | ||
@@ -107,7 +110,10 @@ class PtestRunnerTest(OERuntimeTestCase): | |||
107 | failmsg = "ERROR: Processes were killed by the OOM Killer:\n%s\n" % output | 110 | failmsg = "ERROR: Processes were killed by the OOM Killer:\n%s\n" % output |
108 | 111 | ||
109 | if failed_tests: | 112 | if failed_tests: |
110 | failmsg = failmsg + "Failed ptests:\n%s" % pprint.pformat(failed_tests) | 113 | failmsg = failmsg + "\nFailed ptests:\n%s\n" % pprint.pformat(failed_tests) |
114 | |||
115 | if zerolength: | ||
116 | failmsg = failmsg + "\nptests which had no test results:\n%s" % pprint.pformat(zerolength) | ||
111 | 117 | ||
112 | if failmsg: | 118 | if failmsg: |
113 | self.logger.warning("There were failing ptests.") | 119 | self.logger.warning("There were failing ptests.") |