From 1fdf8c00764af9e32f8dec13061f625f48bd4c8c Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Tue, 19 Jan 2021 10:30:06 -0800 Subject: gitlab-ci: print output and logs for failed tests Signed-off-by: Allan McRae --- build-aux/print-failed-test-output | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 build-aux/print-failed-test-output (limited to 'build-aux/print-failed-test-output') diff --git a/build-aux/print-failed-test-output b/build-aux/print-failed-test-output new file mode 100755 index 00000000..1f1ab76d --- /dev/null +++ b/build-aux/print-failed-test-output @@ -0,0 +1,17 @@ +#!/usr/bin/python + +import json +import sys + +def print_result(result): + print('==================================================================') + print(result['name']) + print(' '.join(result['command'])) + print('==================================================================') + print(result['stdout']) + +with open(sys.argv[1], 'r') as f: + for line in f: + result = json.loads(line) + if result['result'] == 'FAIL': + print_result(result) -- cgit v1.2.3-24-g4f1b