Navigation Menu

Skip to content

Commit

Permalink
run Python tests inside docker
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Mar 6, 2019
1 parent 17b8405 commit d42ff34
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 45 deletions.
13 changes: 13 additions & 0 deletions .ci/travis/linux/docker-build-test.sh
Expand Up @@ -166,3 +166,16 @@ popd > /dev/null # build
popd > /dev/null # /root/QGIS

[ -r /tmp/ctest-important.log ] && cat /tmp/ctest-important.log || true

##############################
# Run Python Tests on QGIS app
##############################
pushd /root/QGIS/tests/src/python
# Passing cases:
[[ $(qgis_testrunner.sh test_testrunner.run_passing) -eq '0' ]] || exit 1
[[ $(qgis_testrunner.sh test_testrunner.run_skipped_and_passing) -eq '0' ]] || exit 1
# Failing cases:
[[ $(qgis_testrunner.sh test_testrunner) -eq '1' ]] || exit 1
[[ $(qgis_testrunner.sh test_testrunner.run_all) -eq '1' ]] || exit 1
[[ $(qgis_testrunner.sh test_testrunner.run_failing) -eq '1' ]] || exit 1
popd
28 changes: 0 additions & 28 deletions .ci/travis/linux/docker_test.sh

This file was deleted.

18 changes: 1 addition & 17 deletions .ci/travis/linux/script.sh
Expand Up @@ -17,20 +17,4 @@
set -e

# running QGIS tests
docker-compose -f ${TRAVIS_BUILD_DIR}/.docker/docker-compose.travis.yml run --rm qgis-deps

# running tests for the python test runner
docker run -d --name qgis-testing-environment -v ${TRAVIS_BUILD_DIR}/tests/src/python:/tests_directory -e DISPLAY=:99 "qgis/qgis:${DOCKER_TAG}"
sleep 10 # Wait for xvfb to finish starting
# Temporary workaround until docker images are built
docker cp ${TRAVIS_BUILD_DIR}/.docker/qgis_resources/test_runner/qgis_testrunner.sh qgis-testing-environment:/usr/bin/qgis_testrunner.sh
# Run tests in the docker
# Passing cases:
TEST_SCRIPT_PATH=${TRAVIS_BUILD_DIR}/.ci/travis/linux/docker_test.sh
[[ $(${TEST_SCRIPT_PATH} test_testrunner.run_passing) -eq '0' ]]
[[ $(${TEST_SCRIPT_PATH} test_testrunner.run_skipped_and_passing) -eq '0' ]]
# Failing cases:
[[ $(${TEST_SCRIPT_PATH} test_testrunner) -eq '1' ]]
[[ $(${TEST_SCRIPT_PATH} test_testrunner.run_all) -eq '1' ]]
[[ $(${TEST_SCRIPT_PATH} test_testrunner.run_failing) -eq '1' ]]

docker-compose -f ${TRAVIS_BUILD_DIR}/.docker/docker-compose.travis.yml run qgis-deps
1 change: 1 addition & 0 deletions .docker/docker-compose.travis.yml
Expand Up @@ -33,3 +33,4 @@ services:
- TRAVIS_TIMESTAMP=${TRAVIS_TIMESTAMP}
- QGIS_DISABLE_MESSAGE_HOOKS=1
- QGIS_NO_OVERRIDE_IMPORT=1
- DISPLAY=:99

0 comments on commit d42ff34

Please sign in to comment.