diff --git a/test/integration/dss/test_dss_api.py b/test/integration/dss/test_dss_api.py index 12c87c9d..b3c66145 100755 --- a/test/integration/dss/test_dss_api.py +++ b/test/integration/dss/test_dss_api.py @@ -26,7 +26,9 @@ class TestDssApi(unittest.TestCase): @classmethod def setUpClass(cls): - cls.client = hca.dss.DSSClient() + # Explicitly set to dss-integration rather than what the local config is set to. + # Ensures no bundles are uploaded to dss-prod from operators machine. + cls.client = hca.dss.DSSClient(swagger_url="https://dss.integration.data.humancellatlas.org/v1/swagger.json") def test_set_host(self): with tempfile.TemporaryDirectory() as home: diff --git a/test/integration/dss/test_dss_api_retry.py b/test/integration/dss/test_dss_api_retry.py index 9123febd..53c3e3f4 100755 --- a/test/integration/dss/test_dss_api_retry.py +++ b/test/integration/dss/test_dss_api_retry.py @@ -26,6 +26,10 @@ class TestDssApiRetry(unittest.TestCase): @classmethod def setUpClass(cls): + # Explicitly set to dss-integration rather than what the local config is set to. + # Ensures no bundles are uploaded to dss-prod from operators machine. + cls.client = hca.dss.DSSClient(swagger_url="https://dss.integration.data.humancellatlas.org/v1/swagger.json") + with tempfile.TemporaryDirectory() as src_dir: bundle_path = os.path.join(src_dir, "bundle") os.makedirs(bundle_path) @@ -49,7 +53,7 @@ def test_get_retry(self): Test that GET methods are retried. We instruct the server to fake a 504 with some probability, and we should retry until successful. """ - client = hca.dss.DSSClient() + client = self.client file_uuid = str(uuid.uuid4()) creator_uid = client.config.get("creator_uid", 0) version = datetime.utcnow().strftime("%Y-%m-%dT%H%M%S.%fZ") diff --git a/test/integration/dss/test_dss_cli.py b/test/integration/dss/test_dss_cli.py index b662f777..d6ee0529 100755 --- a/test/integration/dss/test_dss_cli.py +++ b/test/integration/dss/test_dss_cli.py @@ -24,6 +24,16 @@ class TestDssCLI(unittest.TestCase): + @classmethod + def setUpClass(cls): + """ + These tests rely on a logged in env, ensure that the current stage is not dss-prod + """ + config = hca.get_config() + if "https://dss.data.humancellatlas.org" in config['DSSClient']['swagger_url']: + raise ValueError('Please change the DSS swagger endpoint in the HCA config file away from `dss-prod`\n' + 'For more information see: `https://github.com/HumanCellAtlas/dcp-cli#development`') + def test_post_search_cli(self): query = json.dumps({}) replica = "aws"