|
@@ -7,15 +7,24 @@ DEST=$1
|
|
(
|
|
(
|
|
source "$(dirname "$BASH_SOURCE")/.integration-daemon-start"
|
|
source "$(dirname "$BASH_SOURCE")/.integration-daemon-start"
|
|
|
|
|
|
- dockerPy='/docker-py'
|
|
|
|
- [ -d "$dockerPy" ] || {
|
|
|
|
- dockerPy="$DEST/docker-py"
|
|
|
|
- git clone https://github.com/docker/docker-py.git "$dockerPy"
|
|
|
|
- }
|
|
|
|
|
|
+ # we need to wrap up everything in between integration-daemon-start and
|
|
|
|
+ # integration-daemon-stop to make sure we kill the daemon and don't hang,
|
|
|
|
+ # even and especially on test failures
|
|
|
|
+ didFail=
|
|
|
|
+ if ! {
|
|
|
|
+ dockerPy='/docker-py'
|
|
|
|
+ [ -d "$dockerPy" ] || {
|
|
|
|
+ dockerPy="$DEST/docker-py"
|
|
|
|
+ git clone https://github.com/docker/docker-py.git "$dockerPy"
|
|
|
|
+ }
|
|
|
|
|
|
- cd "$dockerPy"
|
|
|
|
- export PYTHONPATH=. # import "docker" from "."
|
|
|
|
- python tests/integration_test.py
|
|
|
|
|
|
+ export PYTHONPATH="$dockerPy" # import "docker" from our local docker-py
|
|
|
|
+ python "$dockerPy/tests/integration_test.py"
|
|
|
|
+ }; then
|
|
|
|
+ didFail=1
|
|
|
|
+ fi
|
|
|
|
|
|
source "$(dirname "$BASH_SOURCE")/.integration-daemon-stop"
|
|
source "$(dirname "$BASH_SOURCE")/.integration-daemon-stop"
|
|
|
|
+
|
|
|
|
+ [ -z "$didFail" ] # "set -e" ftw
|
|
) 2>&1 | tee -a $DEST/test.log
|
|
) 2>&1 | tee -a $DEST/test.log
|