File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,15 +7,24 @@ DEST=$1
77(
88 source " $( dirname " $BASH_SOURCE " ) /.integration-daemon-start"
99
10- dockerPy=' /docker-py'
11- [ -d " $dockerPy " ] || {
12- dockerPy=" $DEST /docker-py"
13- git clone https://github.com/docker/docker-py.git " $dockerPy "
14- }
10+ # we need to wrap up everything in between integration-daemon-start and
11+ # integration-daemon-stop to make sure we kill the daemon and don't hang,
12+ # even and especially on test failures
13+ didFail=
14+ if ! {
15+ dockerPy=' /docker-py'
16+ [ -d " $dockerPy " ] || {
17+ dockerPy=" $DEST /docker-py"
18+ git clone https://github.com/docker/docker-py.git " $dockerPy "
19+ }
1520
16- cd " $dockerPy "
17- export PYTHONPATH=. # import "docker" from "."
18- python tests/integration_test.py
21+ export PYTHONPATH=" $dockerPy " # import "docker" from our local docker-py
22+ python " $dockerPy /tests/integration_test.py"
23+ }; then
24+ didFail=1
25+ fi
1926
2027 source " $( dirname " $BASH_SOURCE " ) /.integration-daemon-stop"
28+
29+ [ -z " $didFail " ] # "set -e" ftw
2130) 2>&1 | tee -a $DEST /test.log
Original file line number Diff line number Diff line change @@ -11,12 +11,22 @@ bundle_test_integration_cli() {
1111(
1212 source " $( dirname " $BASH_SOURCE " ) /.integration-daemon-start"
1313
14- # pull the busybox image before running the tests
15- sleep 2
14+ # we need to wrap up everything in between integration-daemon-start and
15+ # integration-daemon-stop to make sure we kill the daemon and don't hang,
16+ # even and especially on test failures
17+ didFail=
18+ if ! {
19+ # pull the busybox image before running the tests
20+ sleep 2
1621
17- source " $( dirname " $BASH_SOURCE " ) /.ensure-busybox"
22+ source " $( dirname " $BASH_SOURCE " ) /.ensure-busybox"
1823
19- bundle_test_integration_cli
24+ bundle_test_integration_cli
25+ }; then
26+ didFail=1
27+ fi
2028
2129 source " $( dirname " $BASH_SOURCE " ) /.integration-daemon-stop"
30+
31+ [ -z " $didFail " ] # "set -e" ftw
2232) 2>&1 | tee -a $DEST /test.log
You can’t perform that action at this time.
0 commit comments