Skip to content

Commit cb4cf9b

Browse files
authored
Update integration_test.sh
1 parent 76e4023 commit cb4cf9b

File tree

1 file changed

+7
-23
lines changed

1 file changed

+7
-23
lines changed

integration_test.sh

+7-23
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@ echo "Copying ko to temp gopath."
2020
mkdir -p "$GOPATH/src/github.com/google/ko"
2121
cp -r "$ROOT_DIR/"* "$GOPATH/src/github.com/google/ko/"
2222

23-
echo "Downloading github.com/go-training/helloworld"
24-
GO111MODULE=off go get -d github.com/go-training/helloworld
25-
26-
pushd "$GOPATH/src/github.com/google/ko" || exit 1
27-
28-
echo "Replacing hello world in vendor with TEST."
29-
sed -i 's/Hello World/TEST/g' ./vendor/github.com/go-training/helloworld/main.go
30-
3123
echo "Building ko"
3224

3325
RESULT="$(GO111MODULE="on" GOFLAGS="-mod=vendor" go build .)"
@@ -36,15 +28,7 @@ echo "Beginning scenarios."
3628

3729
FILTER="[^ ]local[^ ]*"
3830

39-
echo "1. GOPATH mode should always create an image that outputs 'Hello World'"
40-
RESULT="$(GO111MODULE=off ./ko build --local github.com/go-training/helloworld | grep "$FILTER" | xargs -I% docker run %)"
41-
if [[ "$RESULT" != *"Hello World"** ]]; then
42-
echo "Test FAILED. Saw $RESULT" && exit 1
43-
else
44-
echo "Test PASSED"
45-
fi
46-
47-
echo "2. Go module auto mode should create an image that outputs 'Hello World' when run outside the module."
31+
echo "1. Go module auto mode should create an image that outputs 'Hello World' when run outside the module."
4832

4933
pushd .. || exit 1
5034
RESULT="$(GO111MODULE=auto GOFLAGS="-mod=vendor" ./ko/ko build --local github.com/go-training/helloworld | grep "$FILTER" | xargs -I% docker run %)"
@@ -56,7 +40,7 @@ fi
5640

5741
popd || exit 1
5842

59-
echo "3. Auto inside the module with vendoring should output TEST"
43+
echo "2. Auto inside the module with vendoring should output TEST"
6044

6145
RESULT="$(GO111MODULE=auto GOFLAGS="-mod=vendor" ./ko build --local github.com/go-training/helloworld | grep "$FILTER" | xargs -I% docker run %)"
6246
if [[ "$RESULT" != *"TEST"* ]]; then
@@ -65,36 +49,36 @@ else
6549
echo "Test PASSED"
6650
fi
6751

68-
echo "4. Auto inside the module without vendoring should output TEST"
52+
echo "3. Auto inside the module without vendoring should output TEST"
6953
RESULT="$(GO111MODULE=auto GOFLAGS="" ./ko build --local github.com/go-training/helloworld | grep "$FILTER" | xargs -I% docker run %)"
7054
if [[ "$RESULT" != *"TEST"* ]]; then
7155
echo "Test FAILED. Saw $RESULT" && exit 1
7256
else
7357
echo "Test PASSED"
7458
fi
7559

76-
echo "5. On inside the module with vendor should output TEST."
60+
echo "4. On inside the module with vendor should output TEST."
7761
RESULT="$(GO111MODULE=on GOFLAGS="-mod=vendor" ./ko build --local github.com/go-training/helloworld | grep "$FILTER" | xargs -I% docker run %)"
7862
if [[ "$RESULT" != *"TEST"* ]]; then
7963
echo "Test FAILED. Saw $RESULT" && exit 1
8064
else
8165
echo "Test PASSED"
8266
fi
8367

84-
echo "6. On inside the module without vendor should output TEST"
68+
echo "5. On inside the module without vendor should output TEST"
8569
RESULT="$(GO111MODULE=on GOFLAGS="" ./ko build --local github.com/go-training/helloworld | grep "$FILTER" | xargs -I% docker run %)"
8670
if [[ "$RESULT" != *"TEST"* ]]; then
8771
echo "Test FAILED. Saw $RESULT" && exit 1
8872
else
8973
echo "Test PASSED"
9074
fi
9175

92-
echo "7. On outside the module should fail."
76+
echo "6. On outside the module should fail."
9377
pushd .. || exit 1
9478
GO111MODULE=on ./ko/ko build --local github.com/go-training/helloworld && exit 1
9579
popd || exit 1
9680

97-
echo "8. On outside with build config specifying the test module builds."
81+
echo "7. On outside with build config specifying the test module builds."
9882
pushd test/build-configs || exit 1
9983
for app in foo bar ; do
10084
# test both local and fully qualified import paths

0 commit comments

Comments
 (0)