2018-06-05 11:22:18 +02:00
|
|
|
#!/usr/bin/env bash
|
2016-06-03 10:16:00 +02:00
|
|
|
###########################################################################
|
|
|
|
# script.sh
|
|
|
|
# ---------------------
|
2016-09-27 13:35:50 +02:00
|
|
|
# Date : March 2016
|
|
|
|
# Copyright : (C) 2016 by Matthias Kuhn
|
|
|
|
# Email : matthias at opengis dot ch
|
2016-06-03 10:16:00 +02:00
|
|
|
###########################################################################
|
|
|
|
# #
|
|
|
|
# This program is free software; you can redistribute it and/or modify #
|
|
|
|
# it under the terms of the GNU General Public License as published by #
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or #
|
|
|
|
# (at your option) any later version. #
|
|
|
|
# #
|
|
|
|
###########################################################################
|
|
|
|
|
2017-09-06 10:46:47 +02:00
|
|
|
set -e
|
|
|
|
|
2019-03-07 14:33:53 +01:00
|
|
|
# build QGIS in docker
|
|
|
|
docker run -t --name qgis_container \
|
|
|
|
-v ${TRAVIS_BUILD_DIR}:/root/QGIS \
|
2019-03-07 14:55:08 +01:00
|
|
|
-v ${CCACHE_DIR}:/root/.ccache \
|
2019-03-08 09:37:32 +01:00
|
|
|
--env-file ${TRAVIS_BUILD_DIR}/.ci/travis/linux/docker-variables.env \
|
2019-03-07 14:55:08 +01:00
|
|
|
qgis/qgis3-build-deps:${DOCKER_TAG} \
|
2019-03-07 14:33:53 +01:00
|
|
|
/root/QGIS/.ci/travis/linux/scripts/docker-qgis-build.sh
|
|
|
|
|
|
|
|
# commit container
|
2019-03-07 13:08:35 +01:00
|
|
|
docker commit qgis_container qgis_image
|
|
|
|
|
2019-03-07 14:33:53 +01:00
|
|
|
# running QGIS tests in commited image
|
2019-03-08 08:10:40 +01:00
|
|
|
docker-compose -f ${TRAVIS_BUILD_DIR}/.ci/travis/linux/docker-compose.travis.yml run qgis-deps /root/QGIS/.ci/travis/linux/scripts/docker-qgis-test.sh
|
2019-03-07 13:08:35 +01:00
|
|
|
|
2019-03-08 11:06:52 +01:00
|
|
|
# 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_image "/usr/bin/supervisord -c /etc/supervisor/supervisord.conf"
|
|
|
|
sleep 8 # Wait for xvfb to finish starting
|
2019-03-07 13:20:39 +01:00
|
|
|
|
2019-03-07 13:29:04 +01:00
|
|
|
declare -A testrunners
|
2019-03-07 13:20:39 +01:00
|
|
|
# Passing cases:
|
2019-03-07 13:29:04 +01:00
|
|
|
testrunners["test_testrunner.run_passing"]=0
|
|
|
|
testrunners["test_testrunner.run_skipped_and_passing"]=0
|
2019-03-07 13:20:39 +01:00
|
|
|
# Failing cases:
|
2019-03-07 13:29:04 +01:00
|
|
|
testrunners["test_testrunner"]=1
|
|
|
|
testrunners["test_testrunner.run_all"]=1
|
|
|
|
testrunners["test_testrunner.run_failing"]=1
|
|
|
|
# Run tests in the docker
|
|
|
|
for i in "${!testrunners[@]}"
|
|
|
|
do
|
|
|
|
echo "test ${i}..."
|
2019-03-08 09:26:17 +01:00
|
|
|
[[ $(docker exec -it qgis-testing-environment sh -c "cd /tests_directory && qgis_testrunner.sh ${i}" &>/dev/null) -eq "${testrunners[$i]}" ]] && echo "success" || exit 1
|
2019-03-07 13:29:04 +01:00
|
|
|
done
|