@@ -11,6 +11,7 @@ package test
11
11
import (
12
12
"crypto/tls"
13
13
"fmt"
14
+ "net/http"
14
15
"path/filepath"
15
16
"strings"
16
17
"testing"
@@ -56,6 +57,9 @@ func TestHelmBasicExampleDeployment(t *testing.T) {
56
57
"containerImageRepo" : "nginx" ,
57
58
"containerImageTag" : "1.15.8" ,
58
59
},
60
+ ExtraArgs : map [string ][]string {
61
+ "install" : []string {"--wait" , "--timeout" , "1m30s" },
62
+ },
59
63
}
60
64
<
CE8D
code>61 65
// We generate a unique release name so that we can refer to after deployment.
@@ -81,10 +85,13 @@ func TestHelmBasicExampleDeployment(t *testing.T) {
81
85
// to ensure that we can access it.
82
86
k8s .WaitUntilServiceAvailable (t , kubectlOptions , serviceName , 10 , 1 * time .Second )
83
87
84
- // Now we verify that the service will successfully boot and start serving requests
85
- service := k8s .GetService (t , kubectlOptions , serviceName )
86
- endpoint := k8s .GetServiceEndpoint (t , kubectlOptions , service , 80 )
87
-
88
+ // Now we open a tunnel to port forward service port to localhost
89
+ tunnel := k8s .NewTunnel (
90
+ kubectlOptions , k8s .ResourceTypeService , serviceName , 0 , 80 )
91
+ defer tunnel .Close ()
92
+ tunnel .ForwardPort (t )
93
+ // Get endpoint
94
+ endpoint := tunnel .Endpoint ()
88
95
// Setup a TLS configuration to submit with the helper, a blank struct is acceptable
89
96
tlsConfig := tls.Config {}
90
97
@@ -97,7 +104,7 @@ func TestHelmBasicExampleDeployment(t *testing.T) {
97
104
30 ,
98
105
10 * time .Second ,
99
106
func (statusCode int , body string ) bool {
100
- return statusCode == 200
107
+ return statusCode == http . StatusOK
101
108
},
102
109
)
103
110
}
0 commit comments