diff --git a/.github/workflows/pr-env-deploy.yml b/.github/workflows/pr-env-deploy.yml index 755953b7b..a90419e50 100644 --- a/.github/workflows/pr-env-deploy.yml +++ b/.github/workflows/pr-env-deploy.yml @@ -264,6 +264,53 @@ jobs: - name: Run Integration Tests run: make test-features-integration TF_WORKSPACE_NAME=${{ needs.set-environment-id.outputs.environment_id }} + smoke-test: + name: Run Smoke Tests + needs: [set-environment-id, integration-test] + environment: pull-request + runs-on: [self-hosted, ci] + steps: + - name: Git Clone - ${{ github.event.pull_request.head.ref }} + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + + - name: Setup asdf cache + uses: actions/cache@v4 + with: + path: ~/.asdf + key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }} + restore-keys: | + ${{ runner.os }}-asdf- + + - name: Install asdf and tools + uses: asdf-vm/actions/install@v3.0.2 + with: + asdf_branch: v0.13.1 + + - name: Setup Python environment + run: | + poetry install --no-root + source $(poetry env info --path)/bin/activate + + - name: Configure Management Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-region: eu-west-2 + role-to-assume: ${{ secrets.MGMT_ROLE_ARN }} + role-session-name: github-actions-ci-${{ needs.set-environment-id.outputs.environment_id }} + + - name: Terraform Init + run: | + terraform -chdir=terraform/infrastructure init + terraform -chdir=terraform/infrastructure workspace new ${{ needs.set-environment-id.outputs.environment_id }} || \ + terraform -chdir=terraform/infrastructure workspace select ${{ needs.set-environment-id.outputs.environment_id }} + + - name: Smoke Test + run: | + make ENV=dev truststore-pull-client + make ENV=dev TF_WORKSPACE_NAME=${{ needs.set-environment-id.outputs.environment_id }} test-smoke-internal + performance-test: name: Run Performance Tests needs: [set-environment-id, integration-test] diff --git a/tests/smoke/setup.py b/tests/smoke/setup.py index e93a81aed..a44ebe9bb 100644 --- a/tests/smoke/setup.py +++ b/tests/smoke/setup.py @@ -1,10 +1,11 @@ -from nrlf.core.constants import Categories, PointerTypes +from nrlf.core.constants import TYPE_ATTRIBUTES, Categories, PointerTypes from nrlf.producer.fhir.r4.model import ( Attachment, CodeableConcept, Coding, DocumentReference, DocumentReferenceContent, + DocumentReferenceContext, DocumentReferenceRelatesTo, Identifier, Reference, @@ -35,7 +36,15 @@ def build_document_reference( ) ], type=CodeableConcept( - coding=[Coding(system="http://snomed.info/sct", code=type)] + coding=[ + Coding( + system="http://snomed.info/sct", + code=type, + display=TYPE_ATTRIBUTES.get(f"http://snomed.info/sct|{type}").get( + "display" + ), + ) + ] ), subject=Reference( identifier=Identifier( @@ -67,6 +76,17 @@ def build_document_reference( ] ) ], + context=DocumentReferenceContext( + practiceSetting=CodeableConcept( + coding=[ + Coding( + system="http://snomed.info/sct", + code="390826005", + display="Mental health caregiver support", + ) + ] + ) + ), ) if replaces_id: