aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2023-07-20 23:57:58 -0400
committerTheodore Ts'o <tytso@mit.edu>2023-07-20 23:57:58 -0400
commitdf961e542084285656aa88abbf13bb5bd23750b3 (patch)
treef40a521bf960186271615507be30f54dc7d70598
parentde759f3bf6b877f0608a9fc9a4f7b932cdc5964d (diff)
downloadxfstests-bld-df961e542084285656aa88abbf13bb5bd23750b3.tar.gz
test-appliance: teach gen_results_summary about the preempt marker
In gce-xfstests, the pseudo-test "preempted" will be inserted when VM is preempted, causing it to be terminated and later restarted. Teach the gen_results_summary infrastructure to handle the "preempted" pseudo-test by indicating the number of times the VM was preempted, and not counting it as a test error. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r--test-appliance/files/usr/lib/python3/dist-packages/gen_results_summary.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/test-appliance/files/usr/lib/python3/dist-packages/gen_results_summary.py b/test-appliance/files/usr/lib/python3/dist-packages/gen_results_summary.py
index fe37e64d..719bf3d8 100644
--- a/test-appliance/files/usr/lib/python3/dist-packages/gen_results_summary.py
+++ b/test-appliance/files/usr/lib/python3/dist-packages/gen_results_summary.py
@@ -18,6 +18,8 @@ import time
from datetime import datetime
from junitparser import JUnitXml, Property, Properties, Failure, Error, Skipped
+PREEMPTED = 'preempted'
+
class TestStats:
def __init__(self):
self.failed = 0
@@ -103,6 +105,8 @@ def print_tests(out_f, testsuite, result_type, type_label):
"""Print all of the tests which match a particular result_type"""
wp = wrapped_print(out_f, type_label, ' ')
for testcase in testsuite:
+ if testcase.name == PREEMPTED:
+ continue
match = False
for entry in testcase.result:
if isinstance(entry, result_type):
@@ -183,6 +187,14 @@ def print_summary(out_f, testsuite, verbose):
skipped = testsuite.skipped
failures = testsuite.failures
errors = testsuite.errors
+ Stats = get_testsuite_stats(testsuite)
+ preempts = 0
+ if PREEMPTED in Stats:
+ s = Stats[PREEMPTED]
+ preempts = s.total
+ errors -= s.error
+ tests -= s.total
+ failures -= s.failed
out_f.write('%s: %d tests, ' % (cfg, tests))
if failures > 0:
out_f.write('%d failures, ' % failures)
@@ -190,10 +202,15 @@ def print_summary(out_f, testsuite, verbose):
out_f.write('%d errors, ' % errors)
if skipped > 0:
out_f.write('%d skipped, ' % skipped)
+ if preempts > 0:
+ out_f.write('%d VM preempts, ' % preempts)
out_f.write('%d seconds\n' % runtime)
if verbose:
for test_case in testsuite:
status = ''
+ if test_case.name == PREEMPTED:
+ out_f.write(" Test VM preempted!\n")
+ continue
for entry in test_case.result:
if isinstance(entry, Failure):
status = status + 'Failed,'
@@ -208,10 +225,10 @@ def print_summary(out_f, testsuite, verbose):
out_f.write(" %-12s %-8s %ds\n" %
(test_case.name, status, test_case.time))
else:
- Stats = get_testsuite_stats(testsuite)
-
wp = wrapped_print(out_f, 'Failures', ' ')
for t in Stats:
+ if t == PREEMPTED:
+ continue
s = Stats[t]
if s.failed == 0 or s.total != s.failed:
continue
@@ -220,6 +237,8 @@ def print_summary(out_f, testsuite, verbose):
wp = wrapped_print(out_f, 'Flaky', ' ')
for t in Stats:
+ if t == PREEMPTED:
+ continue
s = Stats[t]
if s.failed == 0 or s.total == s.failed:
continue