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/trial.py b/src/osmo_gsm_tester/trial.py
index 11f8a15..741f3a7 100644
--- a/src/osmo_gsm_tester/trial.py
+++ b/src/osmo_gsm_tester/trial.py
@@ -188,21 +188,23 @@
def run_suites(self, names=None):
self.status = Trial.UNKNOWN
- for suite_run in self.suites:
- try:
- suite_run.run_tests(names)
- except BaseException as e:
- # when the program is aborted by a signal (like Ctrl-C), escalate to abort all.
- self.err('TRIAL RUN ABORTED: %s' % type(e).__name__)
- raise
- finally:
- if suite_run.status != suite.SuiteRun.PASS:
- self.status = Trial.FAIL
- if self.status == Trial.UNKNOWN:
- self.status = Trial.PASS
- junit_path = self.get_run_dir().new_file(self.name()+'.xml')
- self.log('Storing JUnit report in', junit_path)
- report.trial_to_junit_write(self, junit_path)
+ try:
+ for suite_run in self.suites:
+ try:
+ suite_run.run_tests(names)
+ except BaseException as e:
+ # when the program is aborted by a signal (like Ctrl-C), escalate to abort all.
+ self.err('TRIAL RUN ABORTED: %s' % type(e).__name__)
+ raise
+ finally:
+ if suite_run.status != suite.SuiteRun.PASS:
+ self.status = Trial.FAIL
+ if self.status == Trial.UNKNOWN:
+ self.status = Trial.PASS
+ finally:
+ junit_path = self.get_run_dir().new_file(self.name()+'.xml')
+ self.log('Storing JUnit report in', junit_path)
+ report.trial_to_junit_write(self, junit_path)
def log_report(self):
log.large_separator(self.name(), self.status)