ci: Handle missing suite information in test output JSON

The gtk-doc tests are hardcoded by Meson to output as `glib /
gio-doc-check`, `glib / gobject-doc-check`, etc., without an explicit
project name and suite. This causes the following exception in the
report parser:
```
Traceback (most recent call last):
  File ".gitlab-ci/meson-junit-report.py", line 50, in <module>
    (project_name, suite_name) = full_suite.split(':')
ValueError: not enough values to unpack (expected 2, got 1)
```

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2020-05-07 14:15:32 +01:00
parent 74f1e58219
commit cbcc0aa1ea

View File

@ -47,7 +47,11 @@ suites = {}
for line in args.infile: for line in args.infile:
data = json.loads(line) data = json.loads(line)
(full_suite, unit_name) = data['name'].split(' / ') (full_suite, unit_name) = data['name'].split(' / ')
try:
(project_name, suite_name) = full_suite.split(':') (project_name, suite_name) = full_suite.split(':')
except ValueError:
project_name = full_suite
suite_name = full_suite
duration = data['duration'] duration = data['duration']
return_code = data['returncode'] return_code = data['returncode']