Skip to content

Commit ffbfb44

Browse files
Merge pull request docker-archive-public#2337 from dgageot/fix-its
Fix its
2 parents 299d4f6 + f0740fe commit ffbfb44

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

mk/test.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test-short:
66
test-long:
77
$(GO) test $(VERBOSE_GO) -race -tags "$(BUILDTAGS)" $(PKGS)
88

9-
test-integration:
9+
test-integration: build
1010
$(eval TESTSUITE=$(filter-out $@,$(MAKECMDGOALS)))
1111
test/integration/run-bats.sh $(TESTSUITE)
1212

test/integration/core/arbitrary-engine-options.bats

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ load ${BASE_TEST_DIR}/helpers.bash
1414
docker $(machine config $NAME) run --name nolog busybox echo this should not be logged
1515
run docker $(machine config $NAME) logs nolog
1616
echo ${output}
17-
[ $status -eq 1 ]
17+
[ $status -eq 0 ]
18+
[[ ${lines[0]} =~ "no log driver named 'none' is registered" ]]
1819
}

test/integration/core/core-commands.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ load ${BASE_TEST_DIR}/helpers.bash
66
run machine inspect $NAME
77
echo ${output}
88
[ "$status" -eq 1 ]
9-
[[ ${lines[0]} == "Host \"$NAME\" does not exist" ]]
9+
[[ ${lines[0]} =~ "Host does not exist: \"$NAME\"" ]]
1010
}
1111

1212
@test "$DRIVER: create" {

test/integration/run-bats.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ function machine() {
2626

2727
function run_bats() {
2828
for bats_file in $(find "$1" -name \*.bats); do
29+
export NAME="bats-$DRIVER-test-$(date +%s)"
30+
2931
# BATS returns non-zero to indicate the tests have failed, we shouldn't
3032
# neccesarily bail in this case, so that's the reason for the e toggle.
3133
set +e
@@ -62,7 +64,6 @@ fi
6264
# TODO: Should the script bail out if these are set already?
6365
export BASE_TEST_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
6466
export MACHINE_ROOT="$BASE_TEST_DIR/../.."
65-
export NAME="bats-$DRIVER-test"
6667
export MACHINE_STORAGE_PATH="/tmp/machine-bats-test-$DRIVER"
6768
export MACHINE_BIN_NAME=docker-machine
6869
export BATS_LOG="$MACHINE_ROOT/bats.log"
@@ -90,11 +91,4 @@ if [[ -d "$MACHINE_STORAGE_PATH" ]]; then
9091
rm -r "$MACHINE_STORAGE_PATH"
9192
fi
9293

93-
set +e
94-
pkill docker-machine
95-
if [[ $? -eq 0 ]]; then
96-
EXIT_STATUS=1
97-
fi
98-
set -e
99-
10094
exit ${EXIT_STATUS}

0 commit comments

Comments
 (0)