[glib/fix-gnulib-msvc-isnan: 32/37] ci: Handle missing suite information in test output JSON



commit 3a288bc18e9195b00a206ddac04a01b66cfd999c
Author: Philip Withnall <withnall endlessm com>
Date:   Thu May 7 14:15:32 2020 +0100

    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>

 .gitlab-ci/meson-junit-report.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/.gitlab-ci/meson-junit-report.py b/.gitlab-ci/meson-junit-report.py
index 0df07271b..90939ff6c 100755
--- a/.gitlab-ci/meson-junit-report.py
+++ b/.gitlab-ci/meson-junit-report.py
@@ -47,7 +47,11 @@ suites = {}
 for line in args.infile:
     data = json.loads(line)
     (full_suite, unit_name) = data['name'].split(' / ')
-    (project_name, suite_name) = full_suite.split(':')
+    try:
+        (project_name, suite_name) = full_suite.split(':')
+    except ValueError:
+        project_name = full_suite
+        suite_name = full_suite
 
     duration = data['duration']
     return_code = data['returncode']


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]