Skip to content

Commit bb46efe

Browse files
Merge remote-tracking branch 'origin/PRMP-539' into PRMP-539
2 parents 17bd4d2 + d9cc54e commit bb46efe

34 files changed

+2373
-296
lines changed

.github/workflows/base-run-bulk-upload.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,6 @@ jobs:
7777
--empty-lloydgeorge-store
7878
working-directory: ./tests/bulk-upload/scripts
7979

80-
- name: Disable FHIR Stub
81-
run: |
82-
python disable_fhir_stub.py \
83-
--environment "${{ inputs.sandbox }}"
84-
working-directory: ./tests/scripts
85-
8680
- name: Run Bulk Upload
8781
run: |
8882
python run_bulk_upload.py \
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: "Base PDS - Disable PDS Stub"
2+
3+
permissions:
4+
pull-requests: write
5+
id-token: write # This is required for requesting the JWT
6+
contents: read # This is required for actions/checkout
7+
8+
on:
9+
workflow_call:
10+
inputs:
11+
sandbox:
12+
description: "Which Sandbox to push to."
13+
required: true
14+
type: "string"
15+
default: "ndr"
16+
base_branch:
17+
description: "Which Feature Branch for the PDS Disable Script"
18+
required: false
19+
type: "string"
20+
default: "main"
21+
environment:
22+
description: "Which Environment settings to use."
23+
required: true
24+
type: "string"
25+
default: "development"
26+
secrets:
27+
AWS_ASSUME_ROLE:
28+
required: true
29+
30+
jobs:
31+
disable-fhir-stub:
32+
runs-on: ubuntu-latest
33+
environment: ${{ inputs.environment }}
34+
steps:
35+
- name: Configure AWS Credentials for ${{ vars.AWS_REGION }}
36+
uses: aws-actions/configure-aws-credentials@v4
37+
with:
38+
role-to-assume: ${{ secrets.AWS_ASSUME_ROLE }}
39+
role-skip-session-tagging: true
40+
aws-region: ${{ vars.AWS_REGION }}
41+
mask-aws-account-id: true
42+
43+
- name: Checkout repository
44+
uses: actions/checkout@v5
45+
46+
- name: Set up Python
47+
uses: actions/setup-python@v5
48+
with:
49+
python-version: "3.11"
50+
51+
- name: Install dependencies
52+
run: |
53+
python -m pip install --upgrade pip
54+
pip install boto3
55+
working-directory: ./tests/scripts
56+
57+
- name: Disable FHIR Stub
58+
run: |
59+
python disable_fhir_stub.py \
60+
--environment "${{ inputs.sandbox }}"
61+
working-directory: ./tests/scripts

.github/workflows/full-deploy-to-sandbox.yml

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,23 @@ on:
1919
type: "string"
2020
default: "development"
2121
bulk_upload:
22-
description: "Do you want to disable the PDS stub and run a Bulk Upload on this sandbox?"
22+
description: "Do you want to run a Bulk Upload on this sandbox?"
2323
required: true
2424
type: boolean
2525
default: false
26+
disable_pds:
27+
description: "Do you want to disable the PDS stub?"
28+
required: true
29+
type: boolean
30+
default: true
2631
mock_login_enabled:
2732
description: "Do you want to deploy with mock login enabled?"
2833
required: true
2934
type: boolean
3035
default: true
3136

3237
permissions:
33-
actions: read # Required for anchore/sbom-action
38+
actions: read # Required for anchore/sbom-action
3439
contents: write # Required for anchore/sbom-action
3540
pull-requests: write
3641
id-token: write # This is required for requesting the JWT
@@ -99,6 +104,38 @@ jobs:
99104
secrets:
100105
AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }}
101106

107+
disable_fhir_stub:
108+
name: "Disable PDS stub"
109+
if: ${{ inputs.disable_pds || inputs.bulk_upload }}
110+
uses: "./.github/workflows/base-run-disable-pds-stub.yml"
111+
needs: ["deploy_all_lambdas"]
112+
with:
113+
environment: ${{ inputs.environment }}
114+
sandbox: ${{ inputs.sandbox }}
115+
base_branch: ${{ inputs.build_branch }}
116+
secrets:
117+
AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }}
118+
119+
run_lg_e2etest:
120+
uses: ./.github/workflows/base-e2e-backendtest.yml
121+
needs: ["disable_fhir_stub"]
122+
with:
123+
build_branch: ${{ inputs.build_branch }}
124+
environment: development
125+
sandbox: ${{ inputs.sandbox }}
126+
secrets:
127+
AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }}
128+
129+
run_pdm_e2etest:
130+
uses: ./.github/workflows/base-e2e-fhir-backendtest.yml
131+
needs: ["disable_fhir_stub"]
132+
with:
133+
build_branch: ${{ inputs.build_branch }}
134+
environment: development
135+
sandbox: ${{ inputs.sandbox }}
136+
secrets:
137+
AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }}
138+
102139
deploy_ui:
103140
name: Deploy UI
104141
uses: ./.github/workflows/base-deploy-ui.yml
@@ -113,7 +150,7 @@ jobs:
113150
name: "Run Bulk Upload"
114151
if: ${{ inputs.bulk_upload }}
115152
uses: "./.github/workflows/base-run-bulk-upload.yml"
116-
needs: ["deploy_all_lambdas"]
153+
needs: ["run_lg_e2etest", "run_pdm_e2etest"]
117154
with:
118155
environment: ${{ inputs.environment }}
119156
sandbox: ${{ inputs.sandbox }}

.github/workflows/lambdas-deploy-feature-to-sandbox.yml

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
secrets:
7474
AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }}
7575

76-
deploy_all:
76+
deploy_all_lambdas:
7777
name: Deploy all Lambdas
7878
uses: ./.github/workflows/base-lambdas-reusable-deploy-all.yml
7979
needs: ["publish_all_lambda_layers"]
@@ -87,6 +87,33 @@ jobs:
8787
secrets:
8888
AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }}
8989

90-
90+
disable_fhir_stub:
91+
name: "Disable PDS stub"
92+
uses: "./.github/workflows/base-run-disable-pds-stub.yml"
93+
needs: ["deploy_all_lambdas"]
94+
with:
95+
environment: ${{ inputs.environment }}
96+
sandbox: ${{ inputs.sandbox }}
97+
base_branch: ${{ inputs.build_branch }}
98+
secrets:
99+
AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }}
100+
101+
run_lg_e2etest:
102+
uses: ./.github/workflows/base-e2e-backendtest.yml
103+
needs: ["deploy_all_lambdas", "disable_fhir_stub"]
104+
with:
105+
build_branch: ${{ inputs.build_branch }}
106+
environment: development
107+
sandbox: ${{ inputs.sandbox }}
108+
secrets:
109+
AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }}
91110

92-
111+
run_pdm_e2etest:
112+
uses: ./.github/workflows/base-e2e-fhir-backendtest.yml
113+
needs: ["deploy_all_lambdas", "disable_fhir_stub"]
114+
with:
115+
build_branch: ${{ inputs.build_branch }}
116+
environment: development
117+
sandbox: ${{ inputs.sandbox }}
118+
secrets:
119+
AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ share/python-wheels/
2727
MANIFEST
2828
.pip_cache/
2929
package/
30+
lambdas/mtls_env_certs/
3031

3132
# PyInstaller
3233
# Usually these files are written by a python script from a template
@@ -99,6 +100,7 @@ node_modules/
99100
.vscode/
100101

101102
lambdas/tests/unit/helpers/data/pdf/tmp
103+
lambdas/tests/e2e/apim/*.pdf
102104
/lambdas/package_/
103105

104106
# jupyter notebook files

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ test-fhir-api-e2e: ## Runs FHIR API E2E tests. Usage: make test-fhir-api-e2e WOR
7373
./scripts/test/run-e2e-fhir-api-tests.sh --workspace $(WORKSPACE)
7474
rm -rf ./lambdas/mtls_env_certs/$(WORKSPACE)
7575

76+
test-apim-e2e: ## Runs APIM E2E tests for National Document Repository FHIR R4 API against ndr-dev.
77+
./scripts/test/run-apim-e2e-tests.sh
78+
7679
test-api-e2e-snapshots:
7780
cd ./lambdas && ./venv/bin/python3 -m pytest tests/e2e/api --ignore=tests/e2e/api/fhir --snapshot-update
7881

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Our Lambda function readme can be found [here](lambdas/README.md)
88

99
Our React User Interface readme can be found [here](app/README.md)
1010

11+
## End-to-End Tests Intro
12+
13+
Our E2E test readme can be found [here](lambdas/tests/e2e/README.md). We have E2E tests for our FHIR endpoints and APIM setup.
14+
1115
## Installation
1216

1317
- [Git](https://git-scm.com/)

0 commit comments

Comments
 (0)