[glib: 2/6] ci: Handle missing suite information in test output JSON



commit cbcc0aa1ea3de33d06e4b395198047db7b174b4f
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]