@@ -11,6 +11,7 @@ package test
1111import (
1212 "crypto/tls"
1313 "fmt"
14+ "net/http"
1415 "path/filepath"
1516 "strings"
1617 "testing"
@@ -56,6 +57,9 @@ func TestHelmBasicExampleDeployment(t *testing.T) {
5657 "containerImageRepo" : "nginx" ,
5758 "containerImageTag" : "1.15.8" ,
5859 },
60+ ExtraArgs : map [string ][]string {
61+ "install" : []string {"--wait" , "--timeout" , "1m30s" },
62+ },
5963 }
6064
6165 // We generate a unique release name so that we can refer to after deployment.
@@ -81,10 +85,13 @@ func TestHelmBasicExampleDeployment(t *testing.T) {
8185 // to ensure that we can access it.
8286 k8s .WaitUntilServiceAvailable (t , kubectlOptions , serviceName , 10 , 1 * time .Second )
8387
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 ()
8895 // Setup a TLS configuration to submit with the helper, a blank struct is acceptable
8996 tlsConfig := tls.Config {}
9097
@@ -97,7 +104,7 @@ func TestHelmBasicExampleDeployment(t *testing.T) {
97104 30 ,
98105 10 * time .Second ,
99106 func (statusCode int , body string ) bool {
100- return statusCode == 200
107+ return statusCode == http . StatusOK
101108 },
102109 )
103110}
0 commit comments