Skip to content

Commit f1fe24b

Browse files
codablockUdjinM6
authored andcommitted
Only gracefully timeout Travis when integration tests need to be run (#2933)
* Split RUN_TESTS into RUN_UNITTESTS and RUN_INTEGRATIONTESTS * Only gracefully timeout when RUN_INTEGRATIONTESTS=true
1 parent 7c05aa8 commit f1fe24b

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ script:
7575
# Next build should fix this situation as it will start with a populated cache
7676
- if [ $SECONDS -gt 1200 ]; then export TIMEOUT="true"; false; fi # The "false" here ensures that the build is marked as failed even though the whole script returns 0
7777
- test "$TIMEOUT" != "true" && $DOCKER_RUN_IN_BUILDER ./ci/build_src.sh
78-
- if [ $SECONDS -gt 1800 ]; then export TIMEOUT="true"; false; fi # The "false" here ensures that the build is marked as failed even though the whole script returns 0
7978
- test "$TIMEOUT" != "true" && $DOCKER_RUN_IN_BUILDER ./ci/test_unittests.sh
79+
- if [ $SECONDS -gt 1800 -a "$RUN_INTEGRATIONTESTS" = "true" ]; then export TIMEOUT="true"; false; fi # The "false" here ensures that the build is marked as failed even though the whole script returns 0
8080
- test "$TIMEOUT" != "true" && $DOCKER_RUN_IN_BUILDER ./ci/test_integrationtests.sh --jobs=3
8181
- test "$TIMEOUT" != "true" && if [ "$DOCKER_BUILD" = "true" ]; then BUILD_DIR=build-ci/dashcore-$BUILD_TARGET ./docker/build-docker.sh; fi
8282
after_script:

ci/matrix.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ export SDK_URL=${SDK_URL:-https://bitcoincore.org/depends-sources/sdks}
3030
export PYTHON_DEBUG=1
3131
export MAKEJOBS="-j4"
3232

33+
export RUN_UNITTESTS=false
34+
export RUN_INTEGRATIONTESTS=false
35+
3336
if [ "$BUILD_TARGET" = "arm-linux" ]; then
3437
export HOST=arm-linux-gnueabihf
3538
export PACKAGES="g++-arm-linux-gnueabihf"
@@ -41,41 +44,44 @@ elif [ "$BUILD_TARGET" = "win32" ]; then
4144
export PACKAGES="python3 nsis g++-mingw-w64-i686 wine-stable wine32 bc"
4245
export BITCOIN_CONFIG="--enable-gui --enable-reduce-exports --disable-miner"
4346
export DIRECT_WINE_EXEC_TESTS=true
44-
export RUN_TESTS=true
47+
export RUN_UNITTESTS=true
4548
elif [ "$BUILD_TARGET" = "win64" ]; then
4649
export HOST=x86_64-w64-mingw32
4750
export DPKG_ADD_ARCH="i386"
4851
export PACKAGES="python3 nsis g++-mingw-w64-x86-64 wine-stable wine64 bc"
4952
export BITCOIN_CONFIG="--enable-gui --enable-reduce-exports --disable-miner"
5053
export DIRECT_WINE_EXEC_TESTS=true
51-
export RUN_TESTS=true
54+
export RUN_UNITTESTS=true
5255
elif [ "$BUILD_TARGET" = "linux32" ]; then
5356
export HOST=i686-pc-linux-gnu
5457
export PACKAGES="g++-multilib bc python3-zmq"
5558
export BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports --enable-stacktraces LDFLAGS=-static-libstdc++"
5659
export USE_SHELL="/bin/dash"
5760
export PYZMQ=true
58-
export RUN_TESTS=true
61+
export RUN_UNITTESTS=true
62+
export RUN_INTEGRATIONTESTS=true
5963
elif [ "$BUILD_TARGET" = "linux64" ]; then
6064
export HOST=x86_64-unknown-linux-gnu
6165
export PACKAGES="bc python3-zmq"
6266
export DEP_OPTS="NO_UPNP=1 DEBUG=1"
6367
export BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports --enable-stacktraces"
6468
export CPPFLAGS="-DDEBUG_LOCKORDER -DENABLE_DASH_DEBUG"
6569
export PYZMQ=true
66-
export RUN_TESTS=true
70+
export RUN_UNITTESTS=true
71+
export RUN_INTEGRATIONTESTS=true
6772
elif [ "$BUILD_TARGET" = "linux64_nowallet" ]; then
6873
export HOST=x86_64-unknown-linux-gnu
6974
export PACKAGES="python3"
7075
export DEP_OPTS="NO_WALLET=1"
7176
export BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports"
72-
export RUN_TESTS=true
77+
export RUN_UNITTESTS=true
7378
elif [ "$BUILD_TARGET" = "linux64_release" ]; then
7479
export HOST=x86_64-unknown-linux-gnu
7580
export PACKAGES="bc python3-zmq"
7681
export DEP_OPTS="NO_UPNP=1"
7782
export BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports"
7883
export PYZMQ=true
84+
export RUN_UNITTESTS=true
7985
elif [ "$BUILD_TARGET" = "mac" ]; then
8086
export HOST=x86_64-apple-darwin11
8187
export PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools"

ci/test_integrationtests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ PASS_ARGS="$@"
88

99
source ./ci/matrix.sh
1010

11-
if [ "$RUN_TESTS" != "true" ]; then
11+
if [ "$RUN_INTEGRATIONTESTS" != "true" ]; then
1212
echo "Skipping integration tests"
1313
exit 0
1414
fi

ci/test_unittests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -e
66

77
source ./ci/matrix.sh
88

9-
if [ "$RUN_TESTS" != "true" ]; then
9+
if [ "$RUN_UNITTESTS" != "true" ]; then
1010
echo "Skipping unit tests"
1111
exit 0
1212
fi

0 commit comments

Comments
 (0)