]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
ci: try to improve meson's junit.xml
authorVladimír Čunát <vladimir.cunat@nic.cz>
Thu, 15 Apr 2021 17:21:55 +0000 (19:21 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 30 Apr 2021 14:24:43 +0000 (16:24 +0200)
GitLab doesn't show the <system-*> tags, so let's replace them.
For now it's just hacky sed; I can't use xsltproc or similar.

.gitlab-ci.yml
ci/fix-meson-junit.sh [new file with mode: 0755]

index 29d349177e86f4ca38b038646d2115d6ca1b96a2..ea9d3fddc4aa0cdf93f18db293d35eca0b7d5bc0 100644 (file)
@@ -73,6 +73,8 @@ stages:
       - build_dist/meson-dist/*.tar.xz
     reports:
       junit: build_ci*/meson-logs/testlog.junit.xml
+  after_script:
+    - ci/fix-meson-junit.sh build_ci*/meson-logs/testlog.junit.xml
 
 archive:
   <<: *build
diff --git a/ci/fix-meson-junit.sh b/ci/fix-meson-junit.sh
new file mode 100755 (executable)
index 0000000..02cf488
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+sed 's|</testcase>|</testcase>\n|g' -i "$@"
+sed -e '/<failure \/>/,/<\/testcase>/s/<\(\/\?\)system-\(out\|err\)>/<\1failure>/g' \
+       -e 's/<failure \/>//g' \
+       -i "$@"