@@ -31,6 +31,7 @@ type DeisTestConfig struct {
3131 Password string
3232 Email string
3333 ExampleApp string
34+ AppDomain string
3435 AppName string
3536 ProcessNum string
3637 ImageID string
@@ -63,6 +64,10 @@ func GetGlobalConfig() *DeisTestConfig {
6364 if exampleApp == "" {
6465 exampleApp = randomApp
6566 }
67+ appDomain := os .Getenv ("DEIS_TEST_APP_DOMAIN" )
68+ if appDomain == "" {
69+ appDomain = fmt .Sprintf ("test.%s" , domain )
70+ }
6671 var envCfg = DeisTestConfig {
6772 AuthKey : authKey ,
6873 Hosts : hosts ,
@@ -73,6 +78,7 @@ func GetGlobalConfig() *DeisTestConfig {
7378 Password : "asdf1234" ,
7479 Email : "test@test.co.nz" ,
7580 ExampleApp : exampleApp ,
81+ AppDomain : appDomain ,
7682 AppName : "sample" ,
7783 ProcessNum : "2" ,
7884 ImageID : "buildtest" ,
@@ -97,15 +103,18 @@ func doCurl(url string) ([]byte, error) {
97103 return body , nil
98104}
99105
100- // Curl connects to a Deis endpoint to see if the example app is running .
101- func Curl (t * testing.T , params * DeisTestConfig ) {
102- CurlWithFail (t , params , false , "" )
106+ // Curl connects to an endpoint to see if the endpoint is responding .
107+ func Curl (t * testing.T , url string ) {
108+ CurlWithFail (t , url , false , "" )
103109}
104110
105- // CurlWithFail connects to a Deis endpoint to see if the example app is running.
106- func CurlWithFail (t * testing.T , params * DeisTestConfig , failFlag bool , expect string ) {
107- url := "http://" + params .AppName + "." + params .Domain
111+ // CurlApp is a convenience function to see if the example app is running.
112+ func CurlApp (t * testing.T , cfg DeisTestConfig ) {
113+ CurlWithFail (t , fmt .Sprintf ("http://%s.%s" , cfg .AppName , cfg .Domain ), false , "" )
114+ }
108115
116+ // CurlWithFail connects to a Deis endpoint to see if the example app is running.
117+ func CurlWithFail (t * testing.T , url string , failFlag bool , expect string ) {
109118 // FIXME: try the curl a few times
110119 for i := 0 ; i < 20 ; i ++ {
111120 body , err := doCurl (url )
0 commit comments