diff options
author | Pierre Le Marre <dev@wismill.eu> | 2023-04-27 14:59:30 +0200 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2023-04-27 23:42:20 +0000 |
commit | 4669e788a42664e84e12ce1c8e12fbda6d947814 (patch) | |
tree | c347456758d177079d8cbf380e25f73a9400025a /.gitlab-ci | |
parent | 59fbdb519b0c2e0dfc53bb8a2edb8855f7ccb4c3 (diff) | |
download | xkeyboard-config-4669e788a42664e84e12ce1c8e12fbda6d947814.tar.gz |
CI: fix yaml-to-junit-xml script
Additionally, report successful tests count.
Diffstat (limited to '.gitlab-ci')
-rwxr-xr-x | .gitlab-ci/yaml-to-junit-xml.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/.gitlab-ci/yaml-to-junit-xml.py b/.gitlab-ci/yaml-to-junit-xml.py index 4e1f8a4..d215299 100755 --- a/.gitlab-ci/yaml-to-junit-xml.py +++ b/.gitlab-ci/yaml-to-junit-xml.py @@ -16,14 +16,24 @@ parser.add_argument( type=pathlib.Path, help="The YAML output file from the keyboard layout tester", ) +parser.add_argument( + "--additional-successful-tests", + type=int, + default=0, + help="Number of successful tests from another source", +) args = parser.parse_args() if not args.inputfile.exists(): print(f"No such file: {args.inputfile}") sys.exit(0) -with open(args.inputfile) as fd: +with args.inputfile.open() as fd: yml = yaml.safe_load(fd) + # Ensure there is a yaml document + if yml is None: + yml = yaml.safe_load("[]") + doc = minidom.Document() suite = doc.createElement("testsuite") suite.setAttribute("name", "XKB layout compilation tests") @@ -33,7 +43,7 @@ with open(args.inputfile) as fd: # and errors (something else blew up) # We use failures for unrecognized keysyms and errors # for everything else (i.e. keymap compilation errors) - ntests, nfailures, nerrors = 0, 0, 0 + ntests, nfailures, nerrors = args.additional_successful_tests, 0, 0 for testcase in yml: ntests += 1 |