chiark / gitweb /
gitlab-ci: move sdist test run to new fedora job
authorHans-Christoph Steiner <hans@eds.org>
Wed, 6 Dec 2017 16:51:12 +0000 (17:51 +0100)
committerHans-Christoph Steiner <hans@eds.org>
Wed, 6 Dec 2017 19:20:17 +0000 (20:20 +0100)
A full run of the test suite takes quite a bit of time.  This removes one
of the 3 runs from the main 'tests' job, and puts it into the Fedora job.
That test run is mostly to make sure the setup.py and source tarball are
correctly, so that doesn't affect merge requests very often.

This also tests `pip install --user`, which was not really being tested
before.

.gitlab-ci.yml
tests/complete-ci-tests

index 3460f092a4b3a9d3bce11c17802936de1c3ed22e..2b3375728a6b2520dbff83367687e9d9a8d57376 100644 (file)
@@ -91,12 +91,16 @@ fedora_latest:
     - master@fdroid/fdroidserver
   script:
     - dnf -y update
-    - dnf -y install git gnupg java-1.8.0-openjdk-devel python3 python3-pip rsync unzip wget
-    - pip3 install -e .
+    - dnf -y install git gnupg java-1.8.0-openjdk-devel python3 python3-babel
+                     python3-pip rsync unzip wget
+    - ./setup.py compile_catalog sdist
+    - useradd -m -c "test account" --password "fakepassword"  testuser
+    - su testuser --login --command "cd `pwd`; pip3 install --user dist/fdroidserver-*.tar.gz"
+    - test -e ~testuser/.local/share/locale/de/LC_MESSAGES/fdroidserver.mo
     - wget --no-verbose -O tools.zip https://dl.google.com/android/repository/tools_r25.2.4-linux.zip
     - unzip -q tools.zip
     - rm tools.zip
-    - export ANDROID_HOME=~/android-sdk
+    - export ANDROID_HOME=`pwd`/android-sdk
     - mkdir $ANDROID_HOME
     - mv tools $ANDROID_HOME/
     - mkdir -p $ANDROID_HOME/licenses/
@@ -107,5 +111,7 @@ fedora_latest:
     - touch ~/.android/repositories.cfg
     - echo y | $ANDROID_HOME/tools/bin/sdkmanager "platform-tools"
     - echo y | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;25.0.2"
+    - chown -R testuser .
     - cd tests
-    - ./run-tests
+    - su testuser --login --command
+        "cd `pwd`; export ANDROID_HOME=$ANDROID_HOME; fdroid=~testuser/.local/bin/fdroid ./run-tests"
index 37e594897c5de656261429bd69d23eb6d044b74c..4573fcd5cd9468d510a1cc946f4ba0365aa2450f 100755 (executable)
@@ -74,28 +74,6 @@ for locale in *; do
 done
 
 
-#------------------------------------------------------------------------------#
-# test building the source tarball, then installing it
-cd $WORKSPACE
-python3 setup.py compile_catalog sdist
-
-# make sure translation files got compiled and included
-tar tzf dist/fdroidserver-*.tar.gz | grep locale/de/LC_MESSAGES/fdroidserver.mo
-
-rm -rf $WORKSPACE/env
-$pyvenv $WORKSPACE/env
-. $WORKSPACE/env/bin/activate
-# workaround https://github.com/pypa/setuptools/issues/937
-pip3 install --quiet setuptools==33.1.1
-pip3 install --quiet dist/fdroidserver-*.tar.gz
-
-# make sure translation files were installed
-test -e $WORKSPACE/env/share/locale/de/LC_MESSAGES/fdroidserver.mo
-
-# run tests in new pip+pyvenv install
-fdroid=$WORKSPACE/env/bin/fdroid $WORKSPACE/tests/run-tests $apksource
-
-
 #------------------------------------------------------------------------------#
 # test install using install direct from git repo
 cd $WORKSPACE