From 6d5e468db1f07c12140af0cf36ba0d1a09bb4ca9 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 1 Nov 2017 11:12:27 +0100 Subject: [PATCH] Fix .go-autogen warnings The `.integration-test-helpers` script was sourced by `/etc/bash/bash.rc`. However, the `$SCRIPTDIR` environment variable is set through `hack/make.sh`, so will not be set when calling the `.integration-test-helpers` script directly. Before this patch; make BIND_DIR=. shell ... bash: /make/.go-autogen: No such file or directory After this patch, the warning is no longer printed Also removed sourcing `.go-autogen` from test-integration and build-integration-test-binary, as they already sourced `.integration-test-helpers` (which sources `.go-autogen`). Signed-off-by: Sebastiaan van Stijn --- hack/make/.integration-test-helpers | 6 ++++-- hack/make/build-integration-test-binary | 1 - hack/make/test-integration | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hack/make/.integration-test-helpers b/hack/make/.integration-test-helpers index 23780396e0..abd1d0f305 100644 --- a/hack/make/.integration-test-helpers +++ b/hack/make/.integration-test-helpers @@ -5,8 +5,10 @@ # # TESTFLAGS='-check.f DockerSuite.TestBuild*' ./hack/make.sh binary test-integration # - -source "$SCRIPTDIR/make/.go-autogen" +if [ -z $MAKEDIR ]; then + export MAKEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +fi +source "$MAKEDIR/.go-autogen" # Set defaults : ${TEST_REPEAT:=1} diff --git a/hack/make/build-integration-test-binary b/hack/make/build-integration-test-binary index ad3e8c2123..bbd5a22bcc 100755 --- a/hack/make/build-integration-test-binary +++ b/hack/make/build-integration-test-binary @@ -2,7 +2,6 @@ # required by `make build-integration-cli-on-swarm` set -e -source "${MAKEDIR}/.go-autogen" source hack/make/.integration-test-helpers build_test_suite_binaries diff --git a/hack/make/test-integration b/hack/make/test-integration index 0100ac9cc7..c807cd4978 100755 --- a/hack/make/test-integration +++ b/hack/make/test-integration @@ -1,7 +1,6 @@ #!/usr/bin/env bash set -e -o pipefail -source "${MAKEDIR}/.go-autogen" source hack/make/.integration-test-helpers (