gitlab-ci: print output and logs for failed tests
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
f9bc6c2b09
commit
1fdf8c0076
3 changed files with 33 additions and 0 deletions
|
@ -2,6 +2,7 @@ variables:
|
|||
MAKEFLAGS: "-j10"
|
||||
VERBOSE: 1
|
||||
PACMAN_OPTS: --needed --noconfirm --cachedir .pkg-cache
|
||||
PACTEST_OPTS: --review --editor=../build-aux/cat-test-file
|
||||
|
||||
cache:
|
||||
key: pkgs-v1
|
||||
|
@ -9,6 +10,10 @@ cache:
|
|||
# For some reason Gitlab CI only supports storing cache/artifacts in a path relative to the build directory
|
||||
- .pkg-cache
|
||||
|
||||
default:
|
||||
after_script:
|
||||
- build-aux/print-failed-test-output build/meson-logs/testlog.json
|
||||
|
||||
.arch-test:
|
||||
image: archlinux/base
|
||||
before_script:
|
||||
|
|
11
build-aux/cat-test-file
Executable file
11
build-aux/cat-test-file
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import sys
|
||||
|
||||
for path in sys.argv[1:]:
|
||||
print('# -----------------------------------')
|
||||
print('# ' + path + ':')
|
||||
print('# -----------------------------------')
|
||||
with open(path, 'r') as f:
|
||||
for line in f:
|
||||
print('# ' + line, end='')
|
17
build-aux/print-failed-test-output
Executable file
17
build-aux/print-failed-test-output
Executable file
|
@ -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)
|
Loading…
Add table
Reference in a new issue