@@ -137,7 +137,7 @@ func TestMetadata_Envs_Add(t *testing.T) {
137137 defer func () {
138138 clean (t , name , Namespace )
139139 }()
140- if ! waitFor (t , fmt . Sprintf ( "http://%v.%s.%s" , name , Namespace , Domain ),
140+ if ! waitFor (t , ksvcUrl ( name ),
141141 withContentMatch ("OK" )) {
142142 t .Fatal ("handler failed" )
143143 }
@@ -194,7 +194,7 @@ func TestMetadata_Envs_Remove(t *testing.T) {
194194 defer func () {
195195 clean (t , name , Namespace )
196196 }()
197- if ! waitFor (t , fmt . Sprintf ( "http://%v.%s.%s" , name , Namespace , Domain ),
197+ if ! waitFor (t , ksvcUrl ( name ),
198198 withContentMatch ("OK" )) {
199199 t .Fatal ("handler failed" )
200200 }
@@ -230,7 +230,7 @@ func TestMetadata_Envs_Remove(t *testing.T) {
230230 if err := newCmd (t , "deploy" ).Run (); err != nil {
231231 t .Fatal (err )
232232 }
233- if ! waitFor (t , fmt . Sprintf ( "http://%v.%s.%s" , name , Namespace , Domain ),
233+ if ! waitFor (t , ksvcUrl ( name ),
234234 withContentMatch ("OK" )) {
235235 t .Fatal ("handler failed" )
236236 }
@@ -268,7 +268,7 @@ func TestMetadata_Labels_Add(t *testing.T) {
268268 defer func () {
269269 clean (t , name , Namespace )
270270 }()
271- if ! waitFor (t , fmt . Sprintf ( "http://%v.%s.%s" , name , Namespace , Domain )) {
271+ if ! waitFor (t , ksvcUrl ( name )) {
272272 t .Fatal ("function did not deploy correctly" )
273273 }
274274
@@ -318,7 +318,7 @@ func TestMetadata_Labels_Remove(t *testing.T) {
318318 defer func () {
319319 clean (t , name , Namespace )
320320 }()
321- if ! waitFor (t , fmt . Sprintf ( "http://%v.%s.%s" , name , Namespace , Domain )) {
321+ if ! waitFor (t , ksvcUrl ( name )) {
322322 t .Fatal ("function did not deploy correctly" )
323323 }
324324
@@ -350,7 +350,7 @@ func TestMetadata_Labels_Remove(t *testing.T) {
350350 if err := newCmd (t , "deploy" ).Run (); err != nil {
351351 t .Fatal (err )
352352 }
353- if ! waitFor (t , fmt . Sprintf ( "http://%v.%s.%s" , name , Namespace , Domain )) {
353+ if ! waitFor (t , ksvcUrl ( name )) {
354354 t .Fatal ("function did not redeploy correctly" )
355355 }
356356
@@ -494,7 +494,7 @@ func Handle(w http.ResponseWriter, _ *http.Request) {
494494 }()
495495
496496 // Verify the function has access to all volumes
497- if ! waitFor (t , fmt . Sprintf ( "http://%s.%s.%s" , name , Namespace , Domain ),
497+ if ! waitFor (t , ksvcUrl ( name ),
498498 withContentMatch ("OK" )) {
499499 t .Fatal ("function failed to access volumes correctly" )
500500 }
@@ -555,7 +555,7 @@ func Handle(w http.ResponseWriter, _ *http.Request) {
555555 t .Fatal (err )
556556 }
557557
558- if ! waitFor (t , fmt . Sprintf ( "http://%s.%s.%s" , name , Namespace , Domain ),
558+ if ! waitFor (t , ksvcUrl ( name ),
559559 withContentMatch ("OK" )) {
560560 t .Fatal ("function failed after volume removal" )
561561 }
@@ -601,7 +601,7 @@ func TestMetadata_Subscriptions(t *testing.T) {
601601 }
602602 defer clean (t , subscriberName , Namespace )
603603
604- subscriberURL := fmt . Sprintf ( "http://%s.%s.%s" , subscriberName , Namespace , Domain )
604+ subscriberURL := ksvcUrl ( subscriberName )
605605 if ! waitFor (t , subscriberURL , withTemplate ("cloudevents" )) {
606606 t .Fatal ("subscriber not ready" )
607607 }
0 commit comments