From 658054f13a48b7b8cfc479fa6f995621261322c1 Mon Sep 17 00:00:00 2001 From: fspreck <f.spreckelsen@indiscale.com> Date: Thu, 27 Oct 2022 18:12:07 +0200 Subject: [PATCH] FIX: Don't use tox for non-system Python --- .gitlab-ci.yml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e7c68634..b3d72859 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -59,29 +59,23 @@ unittest_py3.8: stage: test needs: [ ] image: python:3.8 - script: - # Python3.8 has problems with tox and pip so use plain pytest here + script: &python_test_script + # Python docker has problems with tox and pip so use plain pytest here - touch ~/.pycaosdb.ini - pip install nose pytest pytest-cov python-dateutil jsonschema==4.0.1 - pip install . - python -m pytest unittests +# This needs to be changed once Python 3.9 isn't the standard Python in Debian +# anymore. unittest_py3.9: tags: [ docker ] stage: test needs: [ ] - image: python:3.9 - script: &python_test_script - # Python3.8 has problems with tox and pip so use plain pytest here + script: - touch ~/.pycaosdb.ini - - cd unittests/docker - - cp sources.list.local /etc/apt/ - - mv /etc/apt/sources.list /etc/apt/sources.list.orig - - cat /etc/apt/sources.list.local /etc/apt/sources.list.orig > /etc/apt/sources.list - - apt-get update && apt-get install -y tox - - cd ../.. - make unittest - + unittest_py3.10: tags: [ docker ] @@ -116,12 +110,12 @@ build-testenv: stage: setup only: - schedules - script: + script: - cd unittests/docker - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY # use here general latest or specific branch latest... - docker pull $CI_REGISTRY_IMAGE|| true - - docker build + - docker build --pull --build-arg COMMIT=$CI_COMMIT_SHORT_SHA --cache-from $CI_REGISTRY_IMAGE -- GitLab