fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/42658?usp=email )
Change subject: contrib/jenkins.sh: add support for "Jenkins: skip-card-tests" marker ......................................................................
contrib/jenkins.sh: add support for "Jenkins: skip-card-tests" marker
Add a have_jenkins_marker() helper that checks the commit message for a given value on the "Jenkins:" footer line, for instance:
Jenkins: skip-card-tests
When this marker is present, the real-card integration tests (pySim-prog_test and pySim-shell_test) are skipped, allowing commits that don't affect card I/O to bypass long card-dependent test runs.
Change-Id: If76d812ee43b7eb3b57fdc660c60bf31fbff5b16 Jenkins: skip-card-tests --- M contrib/jenkins.sh 1 file changed, 15 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/58/42658/1
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index c527a83..4df7277 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -15,6 +15,10 @@ . venv/bin/activate }
+have_jenkins_marker() { + git show --summary HEAD | grep "Jenkins:" | grep -q "$1" +} + if [ ! -d "./tests/" ] ; then echo "###############################################" echo "Please call from pySim-prog top directory" @@ -36,17 +40,21 @@ # Execute automatically discovered unit tests first python -m unittest discover -v -s tests/unittests
- # Run pySim-prog integration tests (requires physical cards) - cd tests/pySim-prog_test/ - ./pySim-prog_test.sh - cd ../../ + if have_jenkins_marker "skip-card-tests"; then + echo "Skipping real-card tests (skip-card-tests)" + else + # Run pySim-prog integration tests (requires physical cards) + cd tests/pySim-prog_test/ + ./pySim-prog_test.sh + cd ../../ + + # Run pySim-shell integration tests (requires physical cards) + python3 -m unittest discover -v -s ./tests/pySim-shell_test/ + fi
# Run pySim-trace test tests/pySim-trace_test/pySim-trace_test.sh
- # Run pySim-shell integration tests (requires physical cards) - python3 -m unittest discover -v -s ./tests/pySim-shell_test/ - # Run pySim-smpp2sim test tests/pySim-smpp2sim_test/pySim-smpp2sim_test.sh ;;