diff --git a/bin/runtests.sh b/bin/runtests.sh index 1d3e23c54eca5e2933ef6dcd0dcbe2de47b2184d..a335c148fc4116664b97758e68d6449890741452 100755 --- a/bin/runtests.sh +++ b/bin/runtests.sh @@ -1,4 +1,9 @@ #!/bin/bash + +# Convenience script for unit and integration test execution consumed by +# continous integration workflow (travis) +# +# Must return non-zero on any failure. set -e unit_test_path=test/unit_tests/ @@ -19,13 +24,24 @@ case "$1-$2" in PYTHONPATH=. ptw $unit_test_path $code_path --poll -- $unit_test_path ;; integration---ci|integration-) + # Bootstrap and run integration test. + # - always stop and remove docker containers + # - always exit non-zero if either bootstrap or integration tests fail. + # - only run integration tests on bootstrap success + docker-compose \ -f test/docker-compose.yml \ run \ --rm \ bootstrap && \ - docker-compose -f test/docker-compose.yml run --rm integration-test + docker-compose \ + -f test/docker-compose.yml \ + run \ + --rm \ + integration-test || \ + exit_code=1 docker-compose -f test/docker-compose.yml down + exit $exit_code ;; integration---watch) echo "Not implemented"