chiark / gitweb /
jenkins: move tests to separate job
authorHans-Christoph Steiner <hans@eds.org>
Wed, 8 Nov 2017 08:38:02 +0000 (09:38 +0100)
committerHans-Christoph Steiner <hans@eds.org>
Wed, 8 Nov 2017 08:46:56 +0000 (09:46 +0100)
The setup and build_all jobs take a very long time to run, so its really
annoying when they are marked as failed just because one small thing in the
test suite failed.  So move the test suite to its own job that can be run
more frequently.

jenkins-build
jenkins-build-makebuildserver
jenkins-test [new file with mode: 0644]

index cdf36d1435154306c3515e172c00921732f62e1a..2b6106a17de8c65d8ecb2c3361ff63a20a645c55 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 #
-# this is the script run by the Jenkins server to run the build and tests.  Be
-# sure to always run it in its dir, i.e. ./jenkins-build.sh, otherwise it might
+# this is the script run by the Jenkins server to run the build tests.  Be
+# sure to always run it in its dir, i.e. ./jenkins-build, otherwise it might
 # remove things that you don't want it to.
 
 if [ `dirname $0` != "." ]; then
@@ -17,11 +17,6 @@ fi
 set -e
 set -x
 
-# this is a local repo on the Guardian Project Jenkins server
-cd tests
-#./complete-ci-tests /var/www/fdroid
-
-
 # report info about virtualization
 (dmesg | grep -i -e hypervisor -e qemu -e kvm) || true
 (lspci | grep -i -e virtio -e virtualbox -e qemu -e kvm) || true
index 31b95ab8d868c7f3289ef2fad7090d4af8e8b0d7..3abcb30f8d32cf5122a3c598fee56b4ef307457c 100755 (executable)
@@ -86,12 +86,6 @@ if [ -z $ANDROID_HOME ]; then
     fi
 fi
 
-../fdroid init --verbose
-export GNUPGHOME=$WORKSPACE/tests/gnupghome
-echo "gpghome = '$GNUPGHOME'" >> config.py
-echo "gpgkey = 'CE71F7FB'" >> config.py
-echo "build_server_always = True" >> config.py
-
 # if it can't build fdroid, then its really broken
 ../fdroid build --verbose --stop --latest org.fdroid.fdroid
 # Gradle, JNI, preassemble
@@ -100,17 +94,3 @@ echo "build_server_always = True" >> config.py
 ../fdroid build --verbose --stop org.fdroid.fdroid:96150
 # test OTA update ZIP build and publish
 ../fdroid build --verbose --stop org.fdroid.fdroid.privileged.ota:2070
-
-# publish process when building and signing are on separate machines
-test -d repo || mkdir repo
-test -d archive || mkdir archive
-# copy everything over to run on SIGN machine
-../fdroid publish --verbose
-../fdroid gpgsign --verbose
-# copy everything over to run on BUILD machine
-../fdroid update --verbose --nosign
-# copy everything over to run on SIGN machine
-../fdroid signindex --verbose
-
-../fdroid rewritemeta --verbose
-git --no-pager diff
diff --git a/jenkins-test b/jenkins-test
new file mode 100644 (file)
index 0000000..4fcdb21
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/bash
+#
+# this is the script run by the Jenkins server to run the tools tests.  Be
+# sure to always run it in its dir, i.e. ./jenkins-test, otherwise it might
+# remove things that you don't want it to.
+
+if [ `dirname $0` != "." ]; then
+    echo "only run this script like ./`basename $0`"
+    exit
+fi
+
+# jenkins.debian.net slaves do not export WORKSPACE
+if [ -z $WORKSPACE ]; then
+    export WORKSPACE=`pwd`
+fi
+
+set -e
+set -x
+
+cd tests
+./run-tests $WORKSPACE/fdroiddata/unsigned
+
+# set up Android SDK to use the Debian packages in stretch
+export ANDROID_HOME=/usr/lib/android-sdk
+
+# the way we handle jenkins slaves doesn't copy the workspace to the slaves
+# so we need to "manually" clone the git repo hereā€¦
+cd $WORKSPACE/fdroiddata
+
+test -e config.py || ../fdroid init --verbose
+
+export GNUPGHOME=$WORKSPACE/tests/gnupghome
+echo "build_server_always = True" > config.py
+echo "gpghome = '$GNUPGHOME'" >> config.py
+echo "gpgkey = 'CE71F7FB'" >> config.py
+
+# publish process when building and signing are on separate machines
+test -d repo || mkdir repo
+test -d archive || mkdir archive
+# when everything is copied over to run on SIGN machine
+../fdroid publish --verbose
+../fdroid gpgsign --verbose
+# when everything is copied over to run on BUILD machine
+../fdroid update --verbose --nosign
+# when everything is copied over to run on SIGN machine
+../fdroid signindex --verbose
+
+../fdroid rewritemeta --verbose
+git --no-pager diff