tests.sh: special case when running in gitlab_ci
authorJean Privat <jean@pryen.org>
Mon, 18 Feb 2019 15:41:34 +0000 (10:41 -0500)
committerJean Privat <jean@pryen.org>
Mon, 18 Feb 2019 15:41:34 +0000 (10:41 -0500)
When run is a containerized environment, some tests may behave differently.
This prepares some special cases for them.

Cf #2732

Signed-off-by: Jean Privat <jean@pryen.org>

tests/gitlab_ci.skip [new file with mode: 0644]
tests/sav/gitlab_ci/simple_file_server.res [new file with mode: 0644]
tests/tests.sh

diff --git a/tests/gitlab_ci.skip b/tests/gitlab_ci.skip
new file mode 100644 (file)
index 0000000..c611822
--- /dev/null
@@ -0,0 +1,13 @@
+android
+emscripten
+java
+glsl
+mongo
+mpi
+neo
+objc
+postgres
+action_nitro
+asteronits
+nitrpg
+wiringPi
diff --git a/tests/sav/gitlab_ci/simple_file_server.res b/tests/sav/gitlab_ci/simple_file_server.res
new file mode 100644 (file)
index 0000000..e69de29
index 9eda24c..b771914 100755 (executable)
@@ -407,6 +407,11 @@ need_skip()
                echo >>$xml "<testcase classname='`xmlesc "$3"`' name='`xmlesc "$2"`' `timestamp`><skipped/></testcase>"
                return 0
        fi
+       if test -n "GITLAB_CI" && echo "$1" | grep -f "gitlab_ci.skip" >/dev/null 2>&1; then
+               echo "=> $2: [skip gitlab ci]"
+               echo >>$xml "<testcase classname='`xmlesc "$3"`' name='`xmlesc "$2"`' `timestamp`><skipped/></testcase>"
+               return 0
+       fi
 
        # Skip by OS
        local os_skip_file=$UNAME.skip
@@ -572,6 +577,7 @@ case $engine in
 esac
 
 savdirs="sav/`$HOSTNAME` sav/$UNAME sav/$engine $savdirs sav/"
+test -n "$GITLAB_CI" && savdirs="sav/gitlab_ci $savdirs"
 
 # The default nitc compiler
 [ -z "$NITC" ] && find_nitc