[gtk/wip/ebassi/ci-junit-report: 2/4] ci: Call the report script on failure as well



commit cad62eb8930f912743d5a8bb8b32003fd47674ee
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Fri Apr 5 19:29:58 2019 +0100

    ci: Call the report script on failure as well
    
    GitLab's CI will bail out at the first failure, which means the
    JSON-to-JUnit conversion script won't run unless it's part of the same
    script that we run for building an testing.

 .gitlab-ci.yml            |  1 -
 .gitlab-ci/test-docker.sh | 14 ++++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a7fb6c16a1..f8019eb935 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -17,7 +17,6 @@ fedora-x86_64:
   stage: build
   script:
     - bash -x ./.gitlab-ci/test-docker.sh
-    - python3 ./.gitlab-ci/meson-junit-report.py --project-name=gtk --job-id="${CI_JOB_NAME}" 
--output=_build/report.xml _build/meson-logs/testlog.json
   artifacts:
     when: always
     reports:
diff --git a/.gitlab-ci/test-docker.sh b/.gitlab-ci/test-docker.sh
index 17cc7f7313..c070ada43d 100755
--- a/.gitlab-ci/test-docker.sh
+++ b/.gitlab-ci/test-docker.sh
@@ -24,6 +24,8 @@ cd _build
 ninja
 ccache --show-stats
 
+set +e
+
 xvfb-run -a -s "-screen 0 1024x768x24" \
     meson test \
         --timeout-multiplier 2 \
@@ -32,3 +34,15 @@ xvfb-run -a -s "-screen 0 1024x768x24" \
         --no-suite=gtk:gsk \
         --no-suite=gtk:reftest \
         --no-suite=gtk:a11y
+
+# Save the exit code
+exit_code=$?
+
+# We always want to run the report generator
+$srcdir/.gitlab-ci/meson-junit-report.py \
+        --project-name=gtk \
+        --job-id="${CI_JOB_NAME}" \
+        --output=report.xml \
+        meson-logs/testlog.json
+
+exit $exit_code


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