[glib: 4/10] ci: Include stderr output in JUnit XML report
- From: Sebastian Dröge <sdroege src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 4/10] ci: Include stderr output in JUnit XML report
- Date: Mon, 2 Sep 2019 13:53:05 +0000 (UTC)
commit 0cc745f6cbf14e38ce15862fce979bd292f9111f
Author: Philip Withnall <withnall endlessm com>
Date: Thu Aug 22 11:25:49 2019 +0300
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
.gitlab-ci/meson-junit-report.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]