7709: Merge branch 'master' into 7709-api-rails4
[arvados.git] / sdk / go / arvadostest / run_servers.go
index 7edc482639e585effa23629552fd3a1bea216be8..d3b48ea9fb738fb897ce2ed0926dc619c4522bbf 100644 (file)
@@ -22,6 +22,15 @@ func ResetEnv() {
        }
 }
 
+// APIHost returns the address:port of the current test server.
+func APIHost() string {
+       h := authSettings["ARVADOS_API_HOST"]
+       if h == "" {
+               log.Fatal("arvadostest.APIHost() was called but authSettings is not populated")
+       }
+       return h
+}
+
 // ParseAuthSettings parses auth settings from given input
 func ParseAuthSettings(authScript []byte) {
        scanner := bufio.NewScanner(bytes.NewReader(authScript))