Skip to content
Snippets Groups Projects
Commit 9ea70aaf authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

MAINT: refactor pipeleine script

parent 1460d5bf
Branches
Tags
2 merge requests!217TST: Make NamedTemporaryFiles Windows-compatible,!211F refactor pipe
Pipeline #59693 failed
...@@ -104,6 +104,27 @@ stages: ...@@ -104,6 +104,27 @@ stages:
CAOSDB_TAG=${REFTAG}; CAOSDB_TAG=${REFTAG};
fi fi
- echo $CAOSDB_TAG - echo $CAOSDB_TAG
- if [ -z "$PYLIB" ]; then
if echo "$CI_COMMIT_REF_NAME" | grep -c "^f-" ; then
echo "Check if pylib has branch $CI_COMMIT_REF_NAME" ;
if wget https://gitlab.indiscale.com/api/v4/projects/97/repository/branches/${CI_COMMIT_REF_NAME} ; then
PYLIB=$CI_COMMIT_REF_NAME ;
fi;
fi;
fi;
- PYLIB=${PYLIB:-dev}
- echo $PYLIB
- if [ -z "$ADVANCED" ]; then
if echo "$CI_COMMIT_REF_NAME" | grep -c "^f-" ; then
echo "Check if advanced user tools have branch $CI_COMMIT_REF_NAME" ;
if wget https://gitlab.indiscale.com/api/v4/projects/104/repository/branches/${CI_COMMIT_REF_NAME} ; then
ADVANCED=$CI_COMMIT_REF_NAME ;
fi;
fi;
fi;
- ADVANCED=${ADVANCED:-dev}
- echo $ADVANCED
info: info:
tags: [cached-dind] tags: [cached-dind]
...@@ -113,47 +134,58 @@ info: ...@@ -113,47 +134,58 @@ info:
script: script:
- *env - *env
unittest_py3.11:
tags: [cached-dind]
stage: test
image: $CI_REGISTRY_IMAGE
script:
- python3 -c "import sys; assert sys.version.startswith('3.11')"
- tox
unittest_py3.9: unittest_py3.9:
tags: [cached-dind] tags: [cached-dind]
stage: test stage: test
variables:
PYVER: 3.9
image: python:3.9 image: python:3.9
script: &python_test_script script: &python_test_script
# install dependencies # install dependencies
- *env
- pip install pytest pytest-cov - pip install pytest pytest-cov
# TODO: Use f-branch logic here - pip install git+https://gitlab.indiscale.com/caosdb/src/caosdb-pylib.git@${PYLIB}
- pip install git+https://gitlab.indiscale.com/caosdb/src/caosdb-pylib.git@dev - pip install git+https://gitlab.indiscale.com/caosdb/src/caosdb-advanced-user-tools.git@{ADVANCED}
- pip install git+https://gitlab.indiscale.com/caosdb/src/caosdb-advanced-user-tools.git@dev
- pip install .[h5-crawler,spss,rocrate] - pip install .[h5-crawler,spss,rocrate]
- echo "import sys; assert sys.version.startswith('"$PYVER"')"
- python3 -c "import sys; assert sys.version.startswith('"$PYVER"')"
# actual test # actual test
- caosdb-crawler --help - caosdb-crawler --help
- pytest --cov=caosdb -vv ./unittests - pytest --cov=caosdb -vv ./unittests
unittest_py3.10: unittest_py3.10:
tags: [cached-dind] variables:
PYVER: 3.10
stage: test stage: test
tags: [cached-dind]
image: python:3.10 image: python:3.10
script: *python_test_script script: *python_test_script
unittest_py3.12: unittest_py3.11:
variables:
PYVER: 3.9
tags: [cached-dind] tags: [cached-dind]
stage: test stage: test
image: python:3.11
script: *python_test_script
unittest_py3.12:
variables:
PYVER: 3.12
stage: test
tags: [cached-dind]
image: python:3.12 image: python:3.12
script: *python_test_script script: *python_test_script
unittest_py3.13: unittest_py3.13:
variables:
PYVER: 3.13
tags: [cached-dind] tags: [cached-dind]
stage: test stage: test
image: python:3.13 image: python:3.13
script: *python_test_script script: *python_test_script
inttest: inttest:
tags: [docker] tags: [docker]
services: services:
...@@ -170,6 +202,8 @@ inttest: ...@@ -170,6 +202,8 @@ inttest:
- *env - *env
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- echo $CAOSDB_TAG - echo $CAOSDB_TAG
- echo $PYLIB
- echo $ADVANCED
- cd .docker - cd .docker
# Store mariadb version # Store mariadb version
...@@ -233,27 +267,6 @@ build-testenv: ...@@ -233,27 +267,6 @@ build-testenv:
script: script:
- df -h - df -h
- command -v wget - command -v wget
- if [ -z "$PYLIB" ]; then
if echo "$CI_COMMIT_REF_NAME" | grep -c "^f-" ; then
echo "Check if pylib has branch $CI_COMMIT_REF_NAME" ;
if wget https://gitlab.indiscale.com/api/v4/projects/97/repository/branches/${CI_COMMIT_REF_NAME} ; then
PYLIB=$CI_COMMIT_REF_NAME ;
fi;
fi;
fi;
- PYLIB=${PYLIB:-dev}
- echo $PYLIB
- if [ -z "$ADVANCED" ]; then
if echo "$CI_COMMIT_REF_NAME" | grep -c "^f-" ; then
echo "Check if advanced user tools have branch $CI_COMMIT_REF_NAME" ;
if wget https://gitlab.indiscale.com/api/v4/projects/104/repository/branches/${CI_COMMIT_REF_NAME} ; then
ADVANCED=$CI_COMMIT_REF_NAME ;
fi;
fi;
fi;
- ADVANCED=${ADVANCED:-dev}
- echo $ADVANCED
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
# use here general latest or specific branch latest... # use here general latest or specific branch latest...
......
...@@ -6,9 +6,8 @@ skip_missing_interpreters = true ...@@ -6,9 +6,8 @@ skip_missing_interpreters = true
deps = .[h5-crawler,spss,rocrate] deps = .[h5-crawler,spss,rocrate]
pytest pytest
pytest-cov pytest-cov
# TODO: Make this f-branch sensitive caosdb-pylib
git+https://gitlab.indiscale.com/caosdb/src/caosdb-pylib.git@dev caosdb-advanced-user-tools
git+https://gitlab.indiscale.com/caosdb/src/caosdb-advanced-user-tools.git@dev
commands = caosdb-crawler --help commands = caosdb-crawler --help
py.test --cov=caoscrawler -vv {posargs} py.test --cov=caoscrawler -vv {posargs}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment