Skip to content
Snippets Groups Projects
Commit 893a1421 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

Merge branch 'feature/ci-python-select-tests' into 'master'

[ci] Add test selection for Python tests

Closes #1063

See merge request !2802
parents 7fa86e86 a9389edc
No related branches found
No related tags found
1 merge request!2802[ci] Add test selection for Python tests
Pipeline #7870 passed
...@@ -81,10 +81,12 @@ select tests: ...@@ -81,10 +81,12 @@ select tests:
echo "No reference information given." echo "No reference information given."
echo "Skipping test selection, build/test stages will consider all tests!" echo "Skipping test selection, build/test stages will consider all tests!"
touch affectedtests.json touch affectedtests.json
touch changedfiles.txt
fi fi
artifacts: artifacts:
paths: paths:
- affectedtests.json - affectedtests.json
- changedfiles.txt
expire_in: 3 hours expire_in: 3 hours
needs: needs:
- job: configure - job: configure
...@@ -145,9 +147,21 @@ test python: ...@@ -145,9 +147,21 @@ test python:
script: script:
- source bin/testing/ci-setup-python-env.sh - source bin/testing/ci-setup-python-env.sh
- | - |
pushd build-cmake if ([ ! -s changedfiles.txt ] || grep -q python "changedfiles.txt"); then
ctest --output-on-failure -L python if [ ! -s changedfiles.txt ]; then
popd echo "Skipping test selection: considering all Python tests."
else
echo "Detected changes in the Python bindings/Python code: considering all Python tests."
fi
source bin/testing/ci-setup-python-env.sh
pushd build-cmake
ctest --output-on-failure -L python
popd
else
echo "No changes in the Python bindings/Python code detected: skipping tests."
fi
needs: needs:
- job: configure - job: configure
artifacts: true artifacts: true
- job: select tests
artifacts: true
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment