Skip to content

Commit 8ab94e2

Browse files
Merge pull request #754 from NHSDigital/feature/eema1-fix-smoke-tests
add context to smoke test setup
2 parents 70dbd40 + d15fcae commit 8ab94e2

File tree

2 files changed

+69
-2
lines changed

2 files changed

+69
-2
lines changed

.github/workflows/pr-env-deploy.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,53 @@ jobs:
264264
- name: Run Integration Tests
265265
run: make test-features-integration TF_WORKSPACE_NAME=${{ needs.set-environment-id.outputs.environment_id }}
266266

267+
smoke-test:
268+
name: Run Smoke Tests
269+
needs: [set-environment-id, integration-test]
270+
environment: pull-request
271+
runs-on: [self-hosted, ci]
272+
steps:
273+
- name: Git Clone - ${{ github.event.pull_request.head.ref }}
274+
uses: actions/checkout@v4
275+
with:
276+
ref: ${{ github.event.pull_request.head.ref }}
277+
278+
- name: Setup asdf cache
279+
uses: actions/cache@v4
280+
with:
281+
path: ~/.asdf
282+
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
283+
restore-keys: |
284+
${{ runner.os }}-asdf-
285+
286+
- name: Install asdf and tools
287+
uses: asdf-vm/actions/[email protected]
288+
with:
289+
asdf_branch: v0.13.1
290+
291+
- name: Setup Python environment
292+
run: |
293+
poetry install --no-root
294+
source $(poetry env info --path)/bin/activate
295+
296+
- name: Configure Management Credentials
297+
uses: aws-actions/configure-aws-credentials@v4
298+
with:
299+
aws-region: eu-west-2
300+
role-to-assume: ${{ secrets.MGMT_ROLE_ARN }}
301+
role-session-name: github-actions-ci-${{ needs.set-environment-id.outputs.environment_id }}
302+
303+
- name: Terraform Init
304+
run: |
305+
terraform -chdir=terraform/infrastructure init
306+
terraform -chdir=terraform/infrastructure workspace new ${{ needs.set-environment-id.outputs.environment_id }} || \
307+
terraform -chdir=terraform/infrastructure workspace select ${{ needs.set-environment-id.outputs.environment_id }}
308+
309+
- name: Smoke Test
310+
run: |
311+
make ENV=dev truststore-pull-client
312+
make ENV=dev TF_WORKSPACE_NAME=${{ needs.set-environment-id.outputs.environment_id }} test-smoke-internal
313+
267314
performance-test:
268315
name: Run Performance Tests
269316
needs: [set-environment-id, integration-test]

tests/smoke/setup.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
from nrlf.core.constants import Categories, PointerTypes
1+
from nrlf.core.constants import TYPE_ATTRIBUTES, Categories, PointerTypes
22
from nrlf.producer.fhir.r4.model import (
33
Attachment,
44
CodeableConcept,
55
Coding,
66
DocumentReference,
77
DocumentReferenceContent,
8+
DocumentReferenceContext,
89
DocumentReferenceRelatesTo,
910
Identifier,
1011
Reference,
@@ -35,7 +36,15 @@ def build_document_reference(
3536
)
3637
],
3738
type=CodeableConcept(
38-
coding=[Coding(system="http://snomed.info/sct", code=type)]
39+
coding=[
40+
Coding(
41+
system="http://snomed.info/sct",
42+
code=type,
43+
display=TYPE_ATTRIBUTES.get(f"http://snomed.info/sct|{type}").get(
44+
"display"
45+
),
46+
)
47+
]
3948
),
4049
subject=Reference(
4150
identifier=Identifier(
@@ -67,6 +76,17 @@ def build_document_reference(
6776
]
6877
)
6978
],
79+
context=DocumentReferenceContext(
80+
practiceSetting=CodeableConcept(
81+
coding=[
82+
Coding(
83+
system="http://snomed.info/sct",
84+
code="390826005",
85+
display="Mental health caregiver support",
86+
)
87+
]
88+
)
89+
),
7090
)
7191

7292
if replaces_id:

0 commit comments

Comments
 (0)