Skip to content

Commit eb0b618

Browse files
committed
Further support
1 parent 61b9f95 commit eb0b618

7 files changed

Lines changed: 17 additions & 2 deletions

File tree

.github/workflows/run-e2e-automation-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ jobs:
217217
callback_url: "https://oauth.pstmn.io/v1/callback"
218218
username: ${{ secrets.CIS2_E2E_USERNAME }}
219219
scope: "nhs-cis2"
220+
sub_environment: ${{ inputs.sub_environment }}
220221
USE_STATIC_APPS: ${{ inputs.apigee_environment == 'int' && 'True' || 'False' }}
221222
Postman_Auth_client_Id: ${{ secrets.Postman_Auth_client_Id }} # The following static app values are only needed in INT
222223
Postman_Auth_client_Secret: ${{ secrets.Postman_Auth_client_Secret }}

tests/e2e_automation/.env.example.static

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ callback_url=https://oauth.pstmn.io/v1/callback
3737
S3_env=internal-qa
3838
aws_profile_name={your-aws-profile}
3939
PROXY_NAME=immunisation-fhir-api-internal-qa
40+
# This will only not match S3_env in preprod, where we have a blue/green environment
41+
SUB_ENVIRONMENT=internal-qa
4042
## Id/Secret values - please contact Dev or Test team to get these values
4143
username=
4244
scope=

tests/e2e_automation/features/APITests/status.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Scenario: Verify that the /ping endpoint works
88

99
@smoke @sandbox
1010
Scenario: Verify that the /status endpoint works
11+
Given the status API key is available in the given environment
1112
When I send a request to the status endpoint
1213
Then The request will be successful with the status code '200'
1314
And The status response will contain a passing healthcheck

tests/e2e_automation/features/APITests/steps/test_status_steps.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
import pytest
44
import requests
5-
from pytest_bdd import scenarios, then, when
5+
from pytest_bdd import given, scenarios, then, when
6+
from utilities.apigee.apigee_env_helpers import INT_PROXY_NAME, get_proxy_name
67
from utilities.context import ScenarioContext
78
from utilities.http_requests_session import http_requests_session
89

@@ -11,6 +12,13 @@
1112
CONNECTION_ABORTED_ERROR_MSG = "<ExceptionInfo ConnectionError(ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))) tblen=6>"
1213

1314

15+
@given("the status API key is available in the given environment")
16+
def status_api_key_is_available(context: ScenarioContext):
17+
"""The status API key is available in all environments except for INT/PREPROD"""
18+
if get_proxy_name() == INT_PROXY_NAME:
19+
pytest.skip("Status API test skipped in INT environment")
20+
21+
1422
@when("I send a request to the ping endpoint")
1523
def send_request_to_ping_endpoint(context: ScenarioContext) -> None:
1624
context.response = http_requests_session.get(context.baseUrl + "/_ping")

tests/e2e_automation/features/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def context(request, global_context, temp_apigee_apps: list[ApigeeApp] | None) -
8989
"username",
9090
"scope",
9191
"S3_env",
92+
"sub_environment",
9293
"LOCAL_RUN_WITHOUT_S3_UPLOAD",
9394
]
9495
for var in env_vars:

tests/e2e_automation/utilities/batch_S3_buckets.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ def upload_file_to_S3(context):
2121

2222
def wait_for_file_to_move_archive(context, timeout=120, interval=5):
2323
s3 = boto3.client("s3")
24-
source_bucket = f"immunisation-batch-{context.S3_env}-data-sources"
24+
bucket_scope = context.S3_env if context.S3_env != "preprod" else context.sub_environment
25+
source_bucket = f"immunisation-batch-{bucket_scope}-data-sources"
2526
archive_key = f"archive/{context.filename}"
2627
print(f"Waiting for file in archive: s3://{source_bucket}/{archive_key}")
2728
elapsed = 0

tests/e2e_automation/utilities/context.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def __init__(self):
3636
self.expected_version = 1
3737
self.eTag = None
3838
self.S3_env = None
39+
self.sub_environment = None
3940
self.fileName = None
4041
self.vaccine_df = None
4142
self.file_extension = "csv"

0 commit comments

Comments
 (0)