diff options
author | Bastien Nocera <hadess@hadess.net> | 2021-11-30 16:00:19 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2021-11-30 16:13:37 +0100 |
commit | ddf5796900d9ae8381c8299325860f2f928567ff (patch) | |
tree | a5785920d6d50e24dc0cd6492ed9ee246d1a8a96 /.ci/fail_skipped_tests.py | |
parent | 3979491caba62ffb28d2bb304ea3bcc319b3e89d (diff) | |
download | gnome-bluetooth-ddf5796900d9ae8381c8299325860f2f928567ff.tar.gz |
ci: Fail CI when tests are skipped
Diffstat (limited to '.ci/fail_skipped_tests.py')
-rwxr-xr-x | .ci/fail_skipped_tests.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/.ci/fail_skipped_tests.py b/.ci/fail_skipped_tests.py new file mode 100755 index 00000000..63499214 --- /dev/null +++ b/.ci/fail_skipped_tests.py @@ -0,0 +1,25 @@ +#!/usr/bin/python3 + +from lxml import etree +import sys + +def format_title(title): + """Put title in a box""" + box = { + 'tl': '╔', 'tr': '╗', 'bl': '╚', 'br': '╝', 'h': '═', 'v': '║', + } + hline = box['h'] * (len(title) + 2) + + return '\n'.join([ + f"{box['tl']}{hline}{box['tr']}", + f"{box['v']} {title} {box['v']}", + f"{box['bl']}{hline}{box['br']}", + ]) + +tree = etree.parse(sys.argv[1]) +for suite in tree.xpath('/testsuites/testsuite'): + skipped = suite.get('skipped') + if int(skipped) != 0: + print(format_title('Tests were skipped when they should not have been. All the tests must be run in the CI'), + end='\n\n', flush=True) + sys.exit(1) |