Skip to content

Commit 0a4cbb2

Browse files
committed
Fix continuous deployment pipeline
1 parent ac22525 commit 0a4cbb2

6 files changed

Lines changed: 24 additions & 27 deletions

File tree

.github/workflows/continuous-deployment.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
APIGEE_PASSWORD: ${{ secrets.APIGEE_PASSWORD }}
3030
APIGEE_BASIC_AUTH_TOKEN: ${{ secrets.APIGEE_BASIC_AUTH_TOKEN }}
3131
APIGEE_OTP_KEY: ${{ secrets.APIGEE_OTP_KEY }}
32+
CIS2_E2E_USERNAME: ${{ secrets.CIS2_E2E_USERNAME }}
3233
STATUS_API_KEY: ${{ secrets.STATUS_API_KEY }}
3334

3435
run-sandbox-tests:
@@ -44,6 +45,7 @@ jobs:
4445
APIGEE_PASSWORD: ${{ secrets.APIGEE_PASSWORD }}
4546
APIGEE_BASIC_AUTH_TOKEN: ${{ secrets.APIGEE_BASIC_AUTH_TOKEN }}
4647
APIGEE_OTP_KEY: ${{ secrets.APIGEE_OTP_KEY }}
48+
CIS2_E2E_USERNAME: ${{ secrets.CIS2_E2E_USERNAME }}
4749
STATUS_API_KEY: ${{ secrets.STATUS_API_KEY }}
4850

4951
run-internal-dev-tests:
@@ -59,6 +61,7 @@ jobs:
5961
APIGEE_PASSWORD: ${{ secrets.APIGEE_PASSWORD }}
6062
APIGEE_BASIC_AUTH_TOKEN: ${{ secrets.APIGEE_BASIC_AUTH_TOKEN }}
6163
APIGEE_OTP_KEY: ${{ secrets.APIGEE_OTP_KEY }}
64+
CIS2_E2E_USERNAME: ${{ secrets.CIS2_E2E_USERNAME }}
6265
STATUS_API_KEY: ${{ secrets.STATUS_API_KEY }}
6366

6467
deploy-higher-dev-envs:
@@ -78,11 +81,11 @@ jobs:
7881
strategy:
7982
matrix:
8083
sub_environment_name: [ref, internal-qa]
81-
include:
82-
- apigee_environment_name: ref
83-
required_test_suite: proxy_smoke
84-
- apigee_environment_name: internal-qa
85-
required_test_suite: smoke
84+
include:
85+
- sub_environment_name: ref
86+
required_test_suite: proxy_smoke
87+
- sub_environment_name: internal-qa
88+
required_test_suite: smoke
8689
uses: ./.github/workflows/run-e2e-automation-tests.yml
8790
with:
8891
apigee_environment: ${{ matrix.sub_environment_name }}
@@ -94,4 +97,5 @@ jobs:
9497
APIGEE_PASSWORD: ${{ secrets.APIGEE_PASSWORD }}
9598
APIGEE_BASIC_AUTH_TOKEN: ${{ secrets.APIGEE_BASIC_AUTH_TOKEN }}
9699
APIGEE_OTP_KEY: ${{ secrets.APIGEE_OTP_KEY }}
100+
CIS2_E2E_USERNAME: ${{ secrets.CIS2_E2E_USERNAME }}
97101
STATUS_API_KEY: ${{ secrets.STATUS_API_KEY }}

.github/workflows/pr-deploy-and-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@ jobs:
3434
APIGEE_PASSWORD: ${{ secrets.APIGEE_PASSWORD }}
3535
APIGEE_BASIC_AUTH_TOKEN: ${{ secrets.APIGEE_BASIC_AUTH_TOKEN }}
3636
APIGEE_OTP_KEY: ${{ secrets.APIGEE_OTP_KEY }}
37+
CIS2_E2E_USERNAME: ${{ secrets.CIS2_E2E_USERNAME }}
3738
STATUS_API_KEY: ${{ secrets.STATUS_API_KEY }}

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

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: FHIR API and Batch Automation - E2E Tests
22

33
on:
4-
workflow call:
4+
workflow_call:
55
inputs:
66
apigee_environment:
77
required: true
@@ -25,6 +25,8 @@ on:
2525
required: true
2626
APIGEE_OTP_KEY:
2727
required: true
28+
CIS2_E2E_USERNAME:
29+
required: true
2830
STATUS_API_KEY:
2931
required: true
3032
workflow_dispatch:
@@ -127,11 +129,9 @@ jobs:
127129
fi
128130
129131
e2e-tests:
130-
# TODO - test. Will we need further permissions for publishing test reports
131132
permissions:
132133
id-token: write
133-
checks: write
134-
contents: read
134+
contents: write
135135
runs-on: ubuntu-latest
136136
needs: [wait-for-deployment]
137137
environment: ${{ inputs.apigee_environment }}
@@ -206,7 +206,7 @@ jobs:
206206
echo "::add-mask::$token"
207207
echo "APIGEE_ACCESS_TOKEN=$token" >> $GITHUB_ENV
208208
209-
- name: Run Pytest-BDD ${{ inputs.service_under_test }} tests for with the ${{ inputs.suite_to_run }} filter
209+
- name: Run Pytest-BDD ${{ inputs.service_under_test }} tests with the ${{ inputs.suite_to_run }} filter
210210
working-directory: tests/e2e_automation
211211
env:
212212
S3_env: ${{ inputs.sub_environment }}
@@ -231,17 +231,12 @@ jobs:
231231
MEDICUS_client_Id: ${{ secrets.MEDICUS_client_Id }}
232232
MEDICUS_client_Secret: ${{ secrets.MEDICUS_client_Secret }}
233233
aws_token_refresh: "False"
234-
run: |
235-
TEST_PATH="${{ inputs.service_under_test == 'batch' && 'features/batchTest' || inputs.service_under_test == 'fhir_api' && 'features/APITests' || 'features' }}"
236-
TEST_FILTER="${{ inputs.suite_to_run == 'proxy_smoke' && 'Status_feature' || inputs.suite_to_run }}"
234+
TEST_PATH: ${{ inputs.service_under_test == 'batch' && 'features/batchTest' || inputs.service_under_test == 'fhir_api' && 'features/APITests' || 'features' }}
235+
TEST_FILTER: ${{ inputs.suite_to_run == 'proxy_smoke' && 'Status_feature' || inputs.suite_to_run }}
236+
run: poetry run pytest "$TEST_PATH" -m "$TEST_FILTER" --junitxml=output/test-results.xml --alluredir=output/allure-results
237237

238-
poetry run pytest "$TEST_PATH" -m "$TEST_FILTER" --junitxml=output/test-results.xml --alluredir=output/allure-results
239-
240-
# Might need to figure out if this needs to be in certain directory, and needs particular permissions
241-
- name: Publish test results to GitHub UI
242-
working-directory: tests/e2e_automation
238+
- uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5
243239
if: always()
244-
uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5
245240
with:
246241
name: BDD Test Summary
247242
path: "**/output/test-results.xml"

immunisation-fhir-api.code-workspace

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@
4242
{
4343
"path": "tests/e2e_automation",
4444
},
45-
{
46-
"path": "tests/e2e_batch",
47-
},
4845
],
4946
"settings": {},
5047
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
@Status_feature @functional
22
Feature: Get the API status
33

4-
@smoke @sandbox @supplier_name_Postman_Auth
4+
@smoke @sandbox
55
Scenario: Verify that the /ping endpoint works
66
When I send a request to the ping endpoint
77
Then The request will be successful with the status code '200'
88

9-
@smoke @sandbox @supplier_name_Postman_Auth
9+
@smoke @sandbox
1010
Scenario: Verify that the /status endpoint works
1111
When I send a request to the status endpoint
1212
Then The request will be successful with the status code '200'
1313
And The status response will contain a passing healthcheck
1414

15-
@smoke @supplier_name_Postman_Auth
15+
@smoke
1616
Scenario: Verify that clients cannot make a direct connection without mTLS to AWS backend
1717
When I send a direct request to the AWS backend
1818
Then The request is rejected
1919

20-
@smoke @supplier_name_Postman_Auth
20+
@smoke
2121
Scenario: Verify that unauthenticated clients cannot get a successful response from the API
2222
When I send an unauthenticated request to the API
2323
Then The request will be unsuccessful with the status code '401'

tests/e2e_automation/utilities/api_get_header.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def get_delete_url_header(context):
4646
"X-Request-ID": str(uuid.uuid4()),
4747
"Accept": "application/fhir+json",
4848
"Content-Type": "application/fhir+json",
49-
"Authorization": "Bearer " + context.token,
49+
"Authorization": "Bearer " + context.token if context.token is not None else "",
5050
}
5151
context.corrID = context.headers["X-Correlation-ID"]
5252
context.reqID = context.headers["X-Request-ID"]

0 commit comments

Comments
 (0)