bpo-34582: Adds JUnit XML output for regression tests (GH-9210)

This commit is contained in:
Steve Dower 2018-09-18 09:10:26 -07:00 committed by GitHub
parent cb5778f00c
commit d0f49d2f50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 329 additions and 33 deletions

View file

@ -67,7 +67,7 @@ def run_tests_worker(worker_args):
try:
result = runtest(ns, testname)
except KeyboardInterrupt:
result = INTERRUPTED, ''
result = INTERRUPTED, '', None
except BaseException as e:
traceback.print_exc()
result = CHILD_ERROR, str(e)
@ -122,7 +122,7 @@ class MultiprocessThread(threading.Thread):
self.current_test = None
if retcode != 0:
result = (CHILD_ERROR, "Exit code %s" % retcode)
result = (CHILD_ERROR, "Exit code %s" % retcode, None)
self.output.put((test, stdout.rstrip(), stderr.rstrip(),
result))
return False
@ -133,6 +133,7 @@ class MultiprocessThread(threading.Thread):
return True
result = json.loads(result)
assert len(result) == 3, f"Invalid result tuple: {result!r}"
self.output.put((test, stdout.rstrip(), stderr.rstrip(),
result))
return False
@ -195,7 +196,7 @@ def run_tests_multiprocess(regrtest):
regrtest.accumulate_result(test, result)
# Display progress
ok, test_time = result
ok, test_time, xml_data = result
text = format_test_result(test, ok)
if (ok not in (CHILD_ERROR, INTERRUPTED)
and test_time >= PROGRESS_MIN_TIME