File tree 2 files changed +36
-10
lines changed
2 files changed +36
-10
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ # ##########################################################################
3
+ # docker_test.sh
4
+ #
5
+ # Run a particular test on docker testing env and return its exit code
6
+ #
7
+ # Arguments:
8
+ #
9
+ # $1: test name in dotted notation
10
+ #
11
+ # ---------------------
12
+ # Date : November 2018
13
+ # Copyright : (C) 2018 by Alessandro Pasotti
14
+ # Email : elpaso at itopen dot it
15
+ # ##########################################################################
16
+ # #
17
+ # This program is free software; you can redistribute it and/or modify #
18
+ # it under the terms of the GNU General Public License as published by #
19
+ # the Free Software Foundation; either version 2 of the License, or #
20
+ # (at your option) any later version. #
21
+ # #
22
+ # ##########################################################################
23
+
24
+ TEST_NAME=$1
25
+
26
+ docker exec -it qgis-testing-environment sh -c " cd /tests_directory && qgis_testrunner.sh ${TEST_NAME} "
27
+
28
+ echo $?
Original file line number Diff line number Diff line change 42
42
sleep 10 # Wait for xvfb to finish starting
43
43
# Temporary workaround until docker images are built
44
44
docker cp ${TRAVIS_BUILD_DIR} /.docker/qgis_resources/test_runner/qgis_testrunner.sh qgis-testing-environment:/usr/bin/qgis_testrunner.sh
45
- docker exec -it qgis-testing-environment sh -c " cd /tests_directory && qgis_testrunner.sh test_testrunner.run_passing"
46
- docker exec -it qgis-testing-environment sh -c " cd /tests_directory && qgis_testrunner.sh test_testrunner.run_skipped_and_passing"
45
+ # Run tests in the docker
46
+ # Passing cases:
47
+ TEST_SCRIPT_PATH=${TRAVIS_BUILD_DIR} /.ci/linux/docker_test.sh
48
+ [[ $( ${TEST_SCRIPT_PATH} test_testrunner.run_passing) -eq ' 0' ]]
49
+ [[ $( ${TEST_SCRIPT_PATH} test_testrunner.run_skipped_and_passing) -eq ' 0' ]]
47
50
# Failing cases:
48
- set +e
49
- ret=0 && docker exec -it qgis-testing-environment sh -c " cd /tests_directory && qgis_testrunner.sh test_testrunner" || ret=127
50
- [ $ret -eq 127 ] || exit 1 # expected failure
51
- ret=0 && docker exec -it qgis-testing-environment sh -c " cd /tests_directory && qgis_testrunner.sh test_testrunner.run_all" || ret=127
52
- [ $ret -eq 127 ] || exit 1 # expected failure
53
- ret=0 && docker exec -it qgis-testing-environment sh -c " cd /tests_directory && qgis_testrunner.sh test_testrunner.run_failing" || ret=127
54
- [ $ret -eq 127 ] || exit 1 # expected failure
55
- set -e
51
+ [[ $( ${TEST_SCRIPT_PATH} test_testrunner) -eq ' 1' ]]
52
+ [[ $( ${TEST_SCRIPT_PATH} test_testrunner.run_all) -eq ' 1' ]]
53
+ [[ $( ${TEST_SCRIPT_PATH} test_testrunner.run_failing) -eq ' 1' ]]
56
54
fi
You can’t perform that action at this time.
0 commit comments