diff --git a/integration_test.sh b/integration_test.sh index 46b4c15611..182f1e95e6 100755 --- a/integration_test.sh +++ b/integration_test.sh @@ -20,14 +20,6 @@ echo "Copying ko to temp gopath." mkdir -p "$GOPATH/src/github.com/google/ko" cp -r "$ROOT_DIR/"* "$GOPATH/src/github.com/google/ko/" -echo "Downloading github.com/go-training/helloworld" -GO111MODULE=off go get -d github.com/go-training/helloworld - -pushd "$GOPATH/src/github.com/google/ko" || exit 1 - -echo "Replacing hello world in vendor with TEST." -sed -i 's/Hello World/TEST/g' ./vendor/github.com/go-training/helloworld/main.go - echo "Building ko" RESULT="$(GO111MODULE="on" GOFLAGS="-mod=vendor" go build .)" @@ -36,15 +28,7 @@ echo "Beginning scenarios." FILTER="[^ ]local[^ ]*" -echo "1. GOPATH mode should always create an image that outputs 'Hello World'" -RESULT="$(GO111MODULE=off ./ko build --local github.com/go-training/helloworld | grep "$FILTER" | xargs -I% docker run %)" -if [[ "$RESULT" != *"Hello World"** ]]; then - echo "Test FAILED. Saw $RESULT" && exit 1 -else - echo "Test PASSED" -fi - -echo "2. Go module auto mode should create an image that outputs 'Hello World' when run outside the module." +echo "1. Go module auto mode should create an image that outputs 'Hello World' when run outside the module." pushd .. || exit 1 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 popd || exit 1 -echo "3. Auto inside the module with vendoring should output TEST" +echo "2. Auto inside the module with vendoring should output TEST" RESULT="$(GO111MODULE=auto GOFLAGS="-mod=vendor" ./ko build --local github.com/go-training/helloworld | grep "$FILTER" | xargs -I% docker run %)" if [[ "$RESULT" != *"TEST"* ]]; then @@ -65,7 +49,7 @@ else echo "Test PASSED" fi -echo "4. Auto inside the module without vendoring should output TEST" +echo "3. Auto inside the module without vendoring should output TEST" RESULT="$(GO111MODULE=auto GOFLAGS="" ./ko build --local github.com/go-training/helloworld | grep "$FILTER" | xargs -I% docker run %)" if [[ "$RESULT" != *"TEST"* ]]; then echo "Test FAILED. Saw $RESULT" && exit 1 @@ -73,7 +57,7 @@ else echo "Test PASSED" fi -echo "5. On inside the module with vendor should output TEST." +echo "4. On inside the module with vendor should output TEST." RESULT="$(GO111MODULE=on GOFLAGS="-mod=vendor" ./ko build --local github.com/go-training/helloworld | grep "$FILTER" | xargs -I% docker run %)" if [[ "$RESULT" != *"TEST"* ]]; then echo "Test FAILED. Saw $RESULT" && exit 1 @@ -81,7 +65,7 @@ else echo "Test PASSED" fi -echo "6. On inside the module without vendor should output TEST" +echo "5. On inside the module without vendor should output TEST" RESULT="$(GO111MODULE=on GOFLAGS="" ./ko build --local github.com/go-training/helloworld | grep "$FILTER" | xargs -I% docker run %)" if [[ "$RESULT" != *"TEST"* ]]; then echo "Test FAILED. Saw $RESULT" && exit 1 @@ -89,12 +73,12 @@ else echo "Test PASSED" fi -echo "7. On outside the module should fail." +echo "6. On outside the module should fail." pushd .. || exit 1 GO111MODULE=on ./ko/ko build --local github.com/go-training/helloworld && exit 1 popd || exit 1 -echo "8. On outside with build config specifying the test module builds." +echo "7. On outside with build config specifying the test module builds." pushd test/build-configs || exit 1 for app in foo bar ; do # test both local and fully qualified import paths