diff --git a/mk/test.mk b/mk/test.mk index 62a0d8b237..9c028729f1 100644 --- a/mk/test.mk +++ b/mk/test.mk @@ -6,7 +6,7 @@ test-short: test-long: $(GO) test $(VERBOSE_GO) -race -tags "$(BUILDTAGS)" $(PKGS) -test-integration: +test-integration: build $(eval TESTSUITE=$(filter-out $@,$(MAKECMDGOALS))) test/integration/run-bats.sh $(TESTSUITE) diff --git a/test/integration/core/arbitrary-engine-options.bats b/test/integration/core/arbitrary-engine-options.bats index f7703bde56..94bd08597e 100644 --- a/test/integration/core/arbitrary-engine-options.bats +++ b/test/integration/core/arbitrary-engine-options.bats @@ -14,5 +14,6 @@ load ${BASE_TEST_DIR}/helpers.bash docker $(machine config $NAME) run --name nolog busybox echo this should not be logged run docker $(machine config $NAME) logs nolog echo ${output} - [ $status -eq 1 ] + [ $status -eq 0 ] + [[ ${lines[0]} =~ "no log driver named 'none' is registered" ]] } diff --git a/test/integration/core/core-commands.bats b/test/integration/core/core-commands.bats index 327ce7134e..9d236f733e 100644 --- a/test/integration/core/core-commands.bats +++ b/test/integration/core/core-commands.bats @@ -6,7 +6,7 @@ load ${BASE_TEST_DIR}/helpers.bash run machine inspect $NAME echo ${output} [ "$status" -eq 1 ] - [[ ${lines[0]} == "Host \"$NAME\" does not exist" ]] + [[ ${lines[0]} =~ "Host does not exist: \"$NAME\"" ]] } @test "$DRIVER: create" { diff --git a/test/integration/run-bats.sh b/test/integration/run-bats.sh index 15068d4718..6903069ac7 100755 --- a/test/integration/run-bats.sh +++ b/test/integration/run-bats.sh @@ -26,6 +26,8 @@ function machine() { function run_bats() { for bats_file in $(find "$1" -name \*.bats); do + export NAME="bats-$DRIVER-test-$(date +%s)" + # BATS returns non-zero to indicate the tests have failed, we shouldn't # neccesarily bail in this case, so that's the reason for the e toggle. set +e @@ -62,7 +64,6 @@ fi # TODO: Should the script bail out if these are set already? export BASE_TEST_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) export MACHINE_ROOT="$BASE_TEST_DIR/../.." -export NAME="bats-$DRIVER-test" export MACHINE_STORAGE_PATH="/tmp/machine-bats-test-$DRIVER" export MACHINE_BIN_NAME=docker-machine export BATS_LOG="$MACHINE_ROOT/bats.log" @@ -90,11 +91,4 @@ if [[ -d "$MACHINE_STORAGE_PATH" ]]; then rm -r "$MACHINE_STORAGE_PATH" fi -set +e -pkill docker-machine -if [[ $? -eq 0 ]]; then - EXIT_STATUS=1 -fi -set -e - exit ${EXIT_STATUS}