Skip to content

Commit 430711d

Browse files
igba1980igba.ujege
andauthored
Stop running test in prod (#52)
* Stop running test in prod * Skip all smoketest in prod --------- Co-authored-by: igba.ujege <igba.ujege@bjss.com>
1 parent f63e901 commit 430711d

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

tests/test_endpoints.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,35 @@
99
import os
1010

1111

12-
@pytest.mark.smoketest
1312
def test_ping(nhsd_apim_proxy_url):
1413
os.environ["PROXY_NAME"] = "dev"
1514
# print(env)
1615
resp = requests.get(f"{nhsd_apim_proxy_url}/_ping")
1716
assert resp.status_code == 200
1817

1918

20-
@pytest.mark.smoketest
2119
def test_wait_for_ping(nhsd_apim_proxy_url):
2220
retries = 0
2321
resp = requests.get(f"{nhsd_apim_proxy_url}/_ping")
24-
deployed_commitId = resp.json().get("commitId")
22+
deployed_commit_id = resp.json().get("commitId")
2523

26-
while (deployed_commitId != getenv('SOURCE_COMMIT_ID')
24+
while (deployed_commit_id != getenv('SOURCE_COMMIT_ID')
2725
and retries <= 30
2826
and resp.status_code == 200):
2927
resp = requests.get(f"{nhsd_apim_proxy_url}/_ping")
30-
deployed_commitId = resp.json().get("commitId")
28+
deployed_commit_id = resp.json().get("commitId")
3129
retries += 1
3230

3331
if resp.status_code != 200:
3432
pytest.fail(f"Status code {resp.status_code}, expecting 200")
3533
elif retries >= 30:
3634
pytest.fail("Timeout Error - max retries")
3735

38-
assert deployed_commitId == getenv('SOURCE_COMMIT_ID')
36+
assert deployed_commit_id == getenv('SOURCE_COMMIT_ID')
3937

4038

4139
@pytest.mark.smoketest
40+
@pytest.mark.skip(reason="No longer required 30/10/2023")
4241
def test_status(nhsd_apim_proxy_url, status_endpoint_auth_headers):
4342
resp = requests.get(
4443
f"{nhsd_apim_proxy_url}/_status", headers=status_endpoint_auth_headers
@@ -47,18 +46,17 @@ def test_status(nhsd_apim_proxy_url, status_endpoint_auth_headers):
4746
# Make some additional assertions about your status response here!
4847

4948

50-
@pytest.mark.smoketest
5149
def test_wait_for_status(nhsd_apim_proxy_url, status_endpoint_auth_headers):
5250
retries = 0
5351
resp = requests.get(f"{nhsd_apim_proxy_url}/_status", headers=status_endpoint_auth_headers)
54-
deployed_commitId = resp.json().get("commitId")
52+
deployed_commit_id = resp.json().get("commitId")
5553

56-
while (deployed_commitId != getenv('SOURCE_COMMIT_ID')
54+
while (deployed_commit_id != getenv('SOURCE_COMMIT_ID')
5755
and retries <= 30
5856
and resp.status_code == 200
5957
and resp.json().get("version")):
6058
resp = requests.get(f"{nhsd_apim_proxy_url}/_status", headers=status_endpoint_auth_headers)
61-
deployed_commitId = resp.json().get("commitId")
59+
deployed_commit_id = resp.json().get("commitId")
6260
retries += 1
6361

6462
if resp.status_code != 200:
@@ -68,7 +66,7 @@ def test_wait_for_status(nhsd_apim_proxy_url, status_endpoint_auth_headers):
6866
elif not resp.json().get("version"):
6967
pytest.fail("version not found")
7068

71-
assert deployed_commitId == getenv('SOURCE_COMMIT_ID')
69+
assert deployed_commit_id == getenv('SOURCE_COMMIT_ID')
7270

7371

7472
def test_app_unauthorised(nhsd_apim_proxy_url, nhsd_apim_auth_headers):

0 commit comments

Comments
 (0)