junit result: also write for aborted runs
Even if aborted due to signal, write a JUnit report XML, and make sure to
indicate the runs as erratic.
Change-Id: I7a334ef3463896c543c0fe592d3903c15e67d4c4
diff --git a/src/osmo_gsm_tester/report.py b/src/osmo_gsm_tester/report.py
index ae63408..82b2f13 100644
--- a/src/osmo_gsm_tester/report.py
+++ b/src/osmo_gsm_tester/report.py
@@ -38,8 +38,9 @@
testsuite = et.Element('testsuite')
testsuite.set('name', suite.name())
testsuite.set('hostname', 'localhost')
- testsuite.set('timestamp', datetime.fromtimestamp(round(suite.start_timestamp)).isoformat())
- testsuite.set('time', str(math.ceil(suite.duration)))
+ if suite.start_timestamp:
+ testsuite.set('timestamp', datetime.fromtimestamp(round(suite.start_timestamp)).isoformat())
+ testsuite.set('time', str(math.ceil(suite.duration)))
testsuite.set('tests', str(len(suite.tests)))
testsuite.set('failures', str(suite.count_test_results()[2]))
for test in suite.tests:
@@ -60,6 +61,9 @@
if test.fail_tb:
system_err = et.SubElement(testcase, 'system-err')
system_err.text = test.fail_tb
+ elif test.status != suite.Test.PASS:
+ error = et.SubElement(testcase, 'error')
+ error.text = 'could not run'
return testcase
def trial_to_text(trial):