summaryrefslogtreecommitdiff
path: root/.ci/fail_skipped_tests.py
blob: 63499214f7689b8cc4edcb652e0b34909b93102a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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)