Skip to content

Commit 330caa6

Browse files
authored
Remove dss-prod from testing (#522)
* move dss-tests away from dss-prod * fixup! move dss-tests away from dss-prod
1 parent 82a8cec commit 330caa6

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

test/integration/dss/test_dss_api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ class TestDssApi(unittest.TestCase):
2626

2727
@classmethod
2828
def setUpClass(cls):
29-
cls.client = hca.dss.DSSClient()
29+
# Explicitly set to dss-integration rather than what the local config is set to.
30+
# Ensures no bundles are uploaded to dss-prod from operators machine.
31+
cls.client = hca.dss.DSSClient(swagger_url="https://dss.integration.data.humancellatlas.org/v1/swagger.json")
3032

3133
def test_set_host(self):
3234
with tempfile.TemporaryDirectory() as home:

test/integration/dss/test_dss_api_retry.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ class TestDssApiRetry(unittest.TestCase):
2626

2727
@classmethod
2828
def setUpClass(cls):
29+
# Explicitly set to dss-integration rather than what the local config is set to.
30+
# Ensures no bundles are uploaded to dss-prod from operators machine.
31+
cls.client = hca.dss.DSSClient(swagger_url="https://dss.integration.data.humancellatlas.org/v1/swagger.json")
32+
2933
with tempfile.TemporaryDirectory() as src_dir:
3034
bundle_path = os.path.join(src_dir, "bundle")
3135
os.makedirs(bundle_path)
@@ -49,7 +53,7 @@ def test_get_retry(self):
4953
Test that GET methods are retried. We instruct the server to fake a 504 with some probability, and we should
5054
retry until successful.
5155
"""
52-
client = hca.dss.DSSClient()
56+
client = self.client
5357
file_uuid = str(uuid.uuid4())
5458
creator_uid = client.config.get("creator_uid", 0)
5559
version = datetime.utcnow().strftime("%Y-%m-%dT%H%M%S.%fZ")

test/integration/dss/test_dss_cli.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@
2424

2525

2626
class TestDssCLI(unittest.TestCase):
27+
@classmethod
28+
def setUpClass(cls):
29+
"""
30+
These tests rely on a logged in env, ensure that the current stage is not dss-prod
31+
"""
32+
config = hca.get_config()
33+
if "https://dss.data.humancellatlas.org" in config['DSSClient']['swagger_url']:
34+
raise ValueError('Please change the DSS swagger endpoint in the HCA config file away from `dss-prod`\n'
35+
'For more information see: `https://github.com/HumanCellAtlas/dcp-cli#development`')
36+
2737
def test_post_search_cli(self):
2838
query = json.dumps({})
2939
replica = "aws"

0 commit comments

Comments
 (0)