Skip to content

Commit d42ff34

Browse files
committedMar 6, 2019
run Python tests inside docker
1 parent 17b8405 commit d42ff34

File tree

4 files changed

+15
-45
lines changed

4 files changed

+15
-45
lines changed
 

‎.ci/travis/linux/docker-build-test.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,16 @@ popd > /dev/null # build
166166
popd > /dev/null # /root/QGIS
167167

168168
[ -r /tmp/ctest-important.log ] && cat /tmp/ctest-important.log || true
169+
170+
##############################
171+
# Run Python Tests on QGIS app
172+
##############################
173+
pushd /root/QGIS/tests/src/python
174+
# Passing cases:
175+
[[ $(qgis_testrunner.sh test_testrunner.run_passing) -eq '0' ]] || exit 1
176+
[[ $(qgis_testrunner.sh test_testrunner.run_skipped_and_passing) -eq '0' ]] || exit 1
177+
# Failing cases:
178+
[[ $(qgis_testrunner.sh test_testrunner) -eq '1' ]] || exit 1
179+
[[ $(qgis_testrunner.sh test_testrunner.run_all) -eq '1' ]] || exit 1
180+
[[ $(qgis_testrunner.sh test_testrunner.run_failing) -eq '1' ]] || exit 1
181+
popd

‎.ci/travis/linux/docker_test.sh

Lines changed: 0 additions & 28 deletions
This file was deleted.

‎.ci/travis/linux/script.sh

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,4 @@
1717
set -e
1818

1919
# running QGIS tests
20-
docker-compose -f ${TRAVIS_BUILD_DIR}/.docker/docker-compose.travis.yml run --rm qgis-deps
21-
22-
# running tests for the python test runner
23-
docker run -d --name qgis-testing-environment -v ${TRAVIS_BUILD_DIR}/tests/src/python:/tests_directory -e DISPLAY=:99 "qgis/qgis:${DOCKER_TAG}"
24-
sleep 10 # Wait for xvfb to finish starting
25-
# Temporary workaround until docker images are built
26-
docker cp ${TRAVIS_BUILD_DIR}/.docker/qgis_resources/test_runner/qgis_testrunner.sh qgis-testing-environment:/usr/bin/qgis_testrunner.sh
27-
# Run tests in the docker
28-
# Passing cases:
29-
TEST_SCRIPT_PATH=${TRAVIS_BUILD_DIR}/.ci/travis/linux/docker_test.sh
30-
[[ $(${TEST_SCRIPT_PATH} test_testrunner.run_passing) -eq '0' ]]
31-
[[ $(${TEST_SCRIPT_PATH} test_testrunner.run_skipped_and_passing) -eq '0' ]]
32-
# Failing cases:
33-
[[ $(${TEST_SCRIPT_PATH} test_testrunner) -eq '1' ]]
34-
[[ $(${TEST_SCRIPT_PATH} test_testrunner.run_all) -eq '1' ]]
35-
[[ $(${TEST_SCRIPT_PATH} test_testrunner.run_failing) -eq '1' ]]
36-
20+
docker-compose -f ${TRAVIS_BUILD_DIR}/.docker/docker-compose.travis.yml run qgis-deps

‎.docker/docker-compose.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ services:
3333
- TRAVIS_TIMESTAMP=${TRAVIS_TIMESTAMP}
3434
- QGIS_DISABLE_MESSAGE_HOOKS=1
3535
- QGIS_NO_OVERRIDE_IMPORT=1
36+
- DISPLAY=:99

0 commit comments

Comments
 (0)
Please sign in to comment.