diff options
author | Philip Withnall <withnall@endlessm.com> | 2019-08-22 11:25:49 +0300 |
---|---|---|
committer | Philip Withnall <withnall@endlessm.com> | 2019-09-02 14:16:33 +0100 |
commit | 0cc745f6cbf14e38ce15862fce979bd292f9111f (patch) | |
tree | 625c1c0ebfb67eead561d640c8eb0d5e01ce523b /.gitlab-ci | |
parent | 197eff3fc8c79fae20be353801f79de9a52ce387 (diff) | |
download | glib-0cc745f6cbf14e38ce15862fce979bd292f9111f.tar.gz |
ci: Include stderr output in JUnit XML report
When running tests under valgrind, the valgrind summary is printed in
stderr, and the TAP output is printed in stdout. The valgrind summary is
useful to include in the GitLab test report, so append it to the
textual failure information for failed tests.
I can’t find a better XML element in the [JUnit
schema](https://github.com/windyroad/JUnit-Schema/blob/master/JUnit.xsd)
for representing it.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Helps: #487
Diffstat (limited to '.gitlab-ci')
-rwxr-xr-x | .gitlab-ci/meson-junit-report.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/.gitlab-ci/meson-junit-report.py b/.gitlab-ci/meson-junit-report.py index 09b89a499..0df07271b 100755 --- a/.gitlab-ci/meson-junit-report.py +++ b/.gitlab-ci/meson-junit-report.py @@ -52,6 +52,7 @@ for line in args.infile: duration = data['duration'] return_code = data['returncode'] log = data['stdout'] + log_stderr = data.get('stderr', '') unit = { 'suite': suite_name, @@ -59,6 +60,7 @@ for line in args.infile: 'duration': duration, 'returncode': return_code, 'stdout': log, + 'stderr': log_stderr, } units = suites.setdefault(suite_name, []) @@ -103,7 +105,7 @@ for name, units in suites.items(): failure.set('classname', '{}/{}'.format(args.project_name, unit['suite'])) failure.set('name', unit['name']) failure.set('type', 'error') - failure.text = unit['stdout'] + failure.text = unit['stdout'] + '\n' + unit['stderr'] output = ET.tostring(testsuites, encoding='unicode') outfile.write(output) |