4297: Merge branch 'master' into 4297-dispatch-load
[arvados.git] / sdk / python / tests / run_test_server.py
index ca0584413cdf113cbe0696febc830d22eee741bd..bd3419c89dae47d857c22cd199c49f1722c3f8e0 100644 (file)
@@ -114,8 +114,8 @@ def run(websockets=False, reuse_server=False):
             subprocess.call(['bundle', 'exec', 'rails', 'server', '-d',
                              '--pid',
                              os.path.join(os.getcwd(), SERVER_PID_PATH),
-                             '-p3001'])
-            os.environ["ARVADOS_API_HOST"] = "127.0.0.1:3001"
+                             '-p3000'])
+            os.environ["ARVADOS_API_HOST"] = "127.0.0.1:3000"
 
         pid = find_server_pid(SERVER_PID_PATH)
 
@@ -176,7 +176,7 @@ def run_keep(blob_signing_key=None, enforce_permissions=False):
     _start_keep(0, keep_args)
     _start_keep(1, keep_args)
 
-    os.environ["ARVADOS_API_HOST"] = "127.0.0.1:3001"
+    os.environ["ARVADOS_API_HOST"] = "127.0.0.1:3000"
     os.environ["ARVADOS_API_HOST_INSECURE"] = "true"
 
     authorize_with("admin")
@@ -210,7 +210,7 @@ def run_keep_proxy(auth):
     if not os.path.exists(TEST_TMPDIR):
         os.mkdir(TEST_TMPDIR)
 
-    os.environ["ARVADOS_API_HOST"] = "127.0.0.1:3001"
+    os.environ["ARVADOS_API_HOST"] = "127.0.0.1:3000"
     os.environ["ARVADOS_API_HOST_INSECURE"] = "true"
     os.environ["ARVADOS_API_TOKEN"] = fixture("api_client_authorizations")[auth]["api_token"]
 
@@ -231,7 +231,13 @@ def fixture(fix):
     '''load a fixture yaml file'''
     with open(os.path.join(SERVICES_SRC_DIR, 'api', "test", "fixtures",
                            fix + ".yml")) as f:
-        return yaml.load(f.read())
+        yaml_file = f.read()
+        try:
+          trim_index = yaml_file.index("# Test Helper trims the rest of the file")
+          yaml_file = yaml_file[0:trim_index]
+        except ValueError:
+          pass
+        return yaml.load(yaml_file)
 
 def authorize_with(token):
     '''token is the symbolic name of the token from the api_client_authorizations fixture'''