gitlab-ci: fix tests using updates from master

This commit is contained in:
Hans-Christoph Steiner 2021-06-01 14:04:16 +02:00
parent 5dddb29bc7
commit 8e8b87e0b4
No known key found for this signature in database
GPG key ID: 3E177817BA1B9BFA

View file

@ -5,14 +5,20 @@ variables:
GIT_DEPTH: 1 GIT_DEPTH: 1
test: # Run the whole test suite in an environment that is like the buildserver guest VM.
ci-images-base run-tests:
image: registry.gitlab.com/fdroid/ci-images-base image: registry.gitlab.com/fdroid/ci-images-base
script: script:
- $pip install -e .[test] - $pip install -e .
# the `fdroid build` test in tests/run-tests needs android-23 - ./tests/run-tests
- echo y | $ANDROID_HOME/tools/bin/sdkmanager "platforms;android-23" > /dev/null # make sure that translations do not cause stacktraces
- cd tests - cd $CI_PROJECT_DIR/locale
- ./complete-ci-tests - for locale in *; do
test -d $locale || continue;
for cmd in `sed -n 's/.*("\(.*\)", *_.*/\1/p' $CI_PROJECT_DIR/fdroid`; do
LANGUAGE=$locale $CI_PROJECT_DIR/fdroid $cmd --help > /dev/null;
done
done
# Test that the parsing of the .yml metadata format didn't change from last # Test that the parsing of the .yml metadata format didn't change from last
# released version. This uses the commit ID of the release tags, # released version. This uses the commit ID of the release tags,
@ -144,20 +150,20 @@ arch_pip_install:
- fdroid update --help - fdroid update --help
lint_format_safety_bandit_checks: lint_format_safety_bandit_checks:
image: alpine:3.10 # cannot upgrade until bandit supports Python 3.8 image: alpine:3.13
variables: variables:
LANG: C.UTF-8 LANG: C.UTF-8
script: script:
- apk add --no-cache bash build-base dash ca-certificates gcc python3 python3-dev - apk add --no-cache bash build-base dash ca-certificates gcc python3 python3-dev
- python3 -m ensurepip - python3 -m ensurepip
- $pip install Babel 'bandit<1.6.0' pycodestyle pyflakes pylint safety - $pip install Babel bandit pycodestyle pyflakes pylint safety
- export EXITVALUE=0 - export EXITVALUE=0
- function set_error() { export EXITVALUE=1; printf "\x1b[31mERROR `history|tail -2|head -1|cut -b 6-500`\x1b[0m\n"; } - function set_error() { export EXITVALUE=1; printf "\x1b[31mERROR `history|tail -2|head -1|cut -b 6-500`\x1b[0m\n"; }
- ./hooks/pre-commit || set_error - ./hooks/pre-commit || set_error
- ./tests/test-gradlew-fdroid || set_error - ./tests/test-gradlew-fdroid || set_error
- bandit - bandit
-ii -ii
-s B110,B322,B404,B408,B410,B603,B607 -s B110,B404,B408,B410,B603,B607
-r $CI_PROJECT_DIR fdroid -r $CI_PROJECT_DIR fdroid
|| set_error || set_error
- safety check --full-report || set_error - safety check --full-report || set_error
@ -321,7 +327,8 @@ plugin_fetchsrclibs:
- fdroid | grep fetchsrclibs - fdroid | grep fetchsrclibs
- mkdir fdroiddata - mkdir fdroiddata
- curl https://gitlab.com/fdroid/fdroiddata/repository/b9e9a077d720c86ff6fff4dbb341254cc4370b1a/archive.tar.gz - commitid=b9e9a077d720c86ff6fff4dbb341254cc4370b1a
- curl https://gitlab.com/fdroid/fdroiddata/-/archive/${commitid}/fdroiddata-${commitid}.tar.gz
| tar -xz --directory=fdroiddata --strip-components=1 | tar -xz --directory=fdroiddata --strip-components=1
- cd fdroiddata - cd fdroiddata
- fdroid fetchsrclibs freemap.opentrail:9 --verbose - fdroid fetchsrclibs freemap.opentrail:9 --verbose