ci: Use result instead of exit code in the JUnit report

We have a result code coming from Meson which is more accurate than just
looking at the exit code of the unit.
This commit is contained in:
Emmanuele Bassi 2020-02-13 13:56:33 +00:00
parent 1a4d1f8994
commit 2b1e273c53

View File

@ -51,6 +51,7 @@ for line in args.infile:
duration = data['duration']
return_code = data['returncode']
result = data['result']
log = data['stdout']
unit = {
@ -58,6 +59,7 @@ for line in args.infile:
'name': unit_name,
'duration': duration,
'returncode': return_code,
'result': result,
'stdout': log,
}
@ -68,12 +70,12 @@ for name, units in suites.items():
print('Processing suite {} (units: {})'.format(name, len(units)))
def if_failed(unit):
if unit['returncode'] != 0:
if unit['result'] in ['FAIL', 'UNEXPECTEDPASS', 'TIMEOUT']:
return True
return False
def if_succeded(unit):
if unit['returncode'] == 0:
if unit['result'] in ['OK', 'EXPECTEDFAIL', 'SKIP']:
return True
return False