@@ -20,14 +20,6 @@ echo "Copying ko to temp gopath."
20
20
mkdir -p " $GOPATH /src/github.com/google/ko"
21
21
cp -r " $ROOT_DIR /" * " $GOPATH /src/github.com/google/ko/"
22
22
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
-
31
23
echo " Building ko"
32
24
33
25
RESULT=" $( GO111MODULE=" on" GOFLAGS=" -mod=vendor" go build .) "
@@ -36,15 +28,7 @@ echo "Beginning scenarios."
36
28
37
29
FILTER=" [^ ]local[^ ]*"
38
30
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."
48
32
49
33
pushd .. || exit 1
50
34
RESULT=" $( GO111MODULE=auto GOFLAGS=" -mod=vendor" ./ko/ko build --local github.com/go-training/helloworld | grep " $FILTER " | xargs -I% docker run %) "
56
40
57
41
popd || exit 1
58
42
59
- echo " 3 . Auto inside the module with vendoring should output TEST"
43
+ echo " 2 . Auto inside the module with vendoring should output TEST"
60
44
61
45
RESULT=" $( GO111MODULE=auto GOFLAGS=" -mod=vendor" ./ko build --local github.com/go-training/helloworld | grep " $FILTER " | xargs -I% docker run %) "
62
46
if [[ " $RESULT " != * " TEST" * ]]; then
65
49
echo " Test PASSED"
66
50
fi
67
51
68
- echo " 4 . Auto inside the module without vendoring should output TEST"
52
+ echo " 3 . Auto inside the module without vendoring should output TEST"
69
53
RESULT=" $( GO111MODULE=auto GOFLAGS=" " ./ko build --local github.com/go-training/helloworld | grep " $FILTER " | xargs -I% docker run %) "
70
54
if [[ " $RESULT " != * " TEST" * ]]; then
71
55
echo " Test FAILED. Saw $RESULT " && exit 1
72
56
else
73
57
echo " Test PASSED"
74
58
fi
75
59
76
- echo " 5 . On inside the module with vendor should output TEST."
60
+ echo " 4 . On inside the module with vendor should output TEST."
77
61
RESULT=" $( GO111MODULE=on GOFLAGS=" -mod=vendor" ./ko build --local github.com/go-training/helloworld | grep " $FILTER " | xargs -I% docker run %) "
78
62
if [[ " $RESULT " != * " TEST" * ]]; then
79
63
echo " Test FAILED. Saw $RESULT " && exit 1
80
64
else
81
65
echo " Test PASSED"
82
66
fi
83
67
84
- echo " 6 . On inside the module without vendor should output TEST"
68
+ echo " 5 . On inside the module without vendor should output TEST"
85
69
RESULT=" $( GO111MODULE=on GOFLAGS=" " ./ko build --local github.com/go-training/helloworld | grep " $FILTER " | xargs -I% docker run %) "
86
70
if [[ " $RESULT " != * " TEST" * ]]; then
87
71
echo " Test FAILED. Saw $RESULT " && exit 1
88
72
else
89
73
echo " Test PASSED"
90
74
fi
91
75
92
- echo " 7 . On outside the module should fail."
76
+ echo " 6 . On outside the module should fail."
93
77
pushd .. || exit 1
94
78
GO111MODULE=on ./ko/ko build --local github.com/go-training/helloworld && exit 1
95
79
popd || exit 1
96
80
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."
98
82
pushd test/build-configs || exit 1
99
83
for app in foo bar ; do
100
84
# test both local and fully qualified import paths
0 commit comments