Browse code

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 <github@gone.nl>

Sebastiaan van Stijn authored on 2017/11/01 19:12:27
Showing 3 changed files
... ...
@@ -5,8 +5,10 @@
5 5
 #
6 6
 #     TESTFLAGS='-check.f DockerSuite.TestBuild*' ./hack/make.sh binary test-integration
7 7
 #
8
-
9
-source "$SCRIPTDIR/make/.go-autogen"
8
+if [ -z $MAKEDIR ]; then
9
+	export MAKEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
10
+fi
11
+source "$MAKEDIR/.go-autogen"
10 12
 
11 13
 # Set defaults
12 14
 : ${TEST_REPEAT:=1}
... ...
@@ -2,7 +2,6 @@
2 2
 # required by `make build-integration-cli-on-swarm`
3 3
 set -e
4 4
 
5
-source "${MAKEDIR}/.go-autogen"
6 5
 source hack/make/.integration-test-helpers
7 6
 
8 7
 build_test_suite_binaries
... ...
@@ -1,7 +1,6 @@
1 1
 #!/usr/bin/env bash
2 2
 set -e -o pipefail
3 3
 
4
-source "${MAKEDIR}/.go-autogen"
5 4
 source hack/make/.integration-test-helpers
6 5
 
7 6
 (