Skip to content

Commit d1b586d

Browse files
committed
NRL-2140 Always use smoke_test_params ods_code for sandbox smoke tests
1 parent 0882c6e commit d1b586d

File tree

4 files changed

+35
-9
lines changed

4 files changed

+35
-9
lines changed

tests/smoke/scenarios/1dsync_upsert_delete.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ def producer_client_1dsync(
1515
if environment_config.connect_mode == ConnectMode.INTERNAL.value:
1616
custom_smoke_test_parameters.nrlf_app_id = "SMOKETEST1DSYNC"
1717

18-
custom_smoke_test_parameters.ods_code = "SMOKETEST1DSYNC"
18+
if environment_config.env_name not in ["dev-sandbox", "qa-sandbox", "int-sandbox"]:
19+
custom_smoke_test_parameters.ods_code = "SMOKETEST1DSYNC"
1920

2021
client_config = environment_config.to_client_config(custom_smoke_test_parameters)
2122

tests/smoke/scenarios/consumer_search_read_v1.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import pytest
44

5-
from tests.smoke.environment import SmokeTestParameters
5+
from tests.smoke.environment import EnvironmentConfig, SmokeTestParameters
66
from tests.smoke.setup import build_document_reference, upsert_test_pointer
77
from tests.utilities.api_clients import ConsumerTestClient, ProducerTestClient
88

@@ -12,8 +12,16 @@ def test_data_v1(
1212
test_nhs_numbers: list[str],
1313
producer_client_v1: ProducerTestClient,
1414
smoke_test_parameters: SmokeTestParameters,
15-
) -> Generator[str, Any, None]:
16-
test_ods_code = smoke_test_parameters.v1_ods_code
15+
environment_config: EnvironmentConfig,
16+
) -> Generator[dict[str, Any], Any, None]:
17+
if (
18+
environment_config.env_name in ["dev-sandbox", "qa-sandbox", "int-sandbox"]
19+
and smoke_test_parameters.ods_code
20+
):
21+
test_ods_code = smoke_test_parameters.ods_code
22+
else:
23+
test_ods_code = smoke_test_parameters.v1_ods_code
24+
1725
test_pointers = [
1826
upsert_test_pointer(
1927
f"{test_ods_code}-smoketest_consumer_search_read_pointer_{n}",

tests/smoke/scenarios/producer_crud_v1.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from tests.smoke.environment import SmokeTestParameters
1+
from tests.smoke.environment import EnvironmentConfig, SmokeTestParameters
22
from tests.smoke.setup import build_document_reference
33
from tests.utilities.api_clients import ProducerTestClient
44

@@ -7,11 +7,19 @@ def test_smoke_producer_crud_v1(
77
producer_client_v1: ProducerTestClient,
88
test_nhs_numbers: list[str],
99
smoke_test_parameters: SmokeTestParameters,
10+
environment_config: EnvironmentConfig,
1011
):
1112
"""
1213
Smoke test scenario for producer CRUD behaviour
1314
"""
14-
test_ods_code = smoke_test_parameters.v1_ods_code
15+
if (
16+
environment_config.env_name in ["dev-sandbox", "qa-sandbox", "int-sandbox"]
17+
and smoke_test_parameters.ods_code
18+
):
19+
test_ods_code = smoke_test_parameters.ods_code
20+
else:
21+
test_ods_code = smoke_test_parameters.v1_ods_code
22+
1523
test_docref = build_document_reference(
1624
nhs_number=test_nhs_numbers[0], custodian=test_ods_code
1725
)

tests/smoke/scenarios/producer_search_read_v1.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import pytest
44

5-
from tests.smoke.environment import SmokeTestParameters
5+
from tests.smoke.environment import EnvironmentConfig, SmokeTestParameters
66
from tests.smoke.setup import build_document_reference, upsert_test_pointer
77
from tests.utilities.api_clients import ProducerTestClient
88

@@ -12,8 +12,17 @@ def test_data(
1212
test_nhs_numbers: list[str],
1313
producer_client_v1: ProducerTestClient,
1414
smoke_test_parameters: SmokeTestParameters,
15-
) -> Generator[str, Any, None]:
16-
test_ods_code = smoke_test_parameters.v1_ods_code
15+
environment_config: EnvironmentConfig,
16+
) -> Generator[dict[str, Any], Any, None]:
17+
18+
if (
19+
environment_config.env_name in ["dev-sandbox", "qa-sandbox", "int-sandbox"]
20+
and smoke_test_parameters.ods_code
21+
):
22+
test_ods_code = smoke_test_parameters.ods_code
23+
else:
24+
test_ods_code = smoke_test_parameters.v1_ods_code
25+
1726
test_pointers = [
1827
upsert_test_pointer(
1928
f"{test_ods_code}-smoketest_producer_count_search_read_pointer_{n}",

0 commit comments

Comments
 (0)