From 94f08dbdc1f8de50c971d8238e09789cf3c1f3e6 Mon Sep 17 00:00:00 2001 From: eesa456 Date: Fri, 29 Nov 2024 15:46:51 +0000 Subject: [PATCH 01/12] SPII-000 add context to smoke test setup --- tests/smoke/setup.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/smoke/setup.py b/tests/smoke/setup.py index e93a81aed..65bd065e2 100644 --- a/tests/smoke/setup.py +++ b/tests/smoke/setup.py @@ -5,6 +5,7 @@ Coding, DocumentReference, DocumentReferenceContent, + DocumentReferenceContext, DocumentReferenceRelatesTo, Identifier, Reference, @@ -67,6 +68,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: From 7ec8278c2bb36bc18d1b5152cdf00c68ce48afac Mon Sep 17 00:00:00 2001 From: eesa456 Date: Fri, 29 Nov 2024 15:55:47 +0000 Subject: [PATCH 02/12] NRL-1213 add smoke tests to pr deploy workflow --- .github/workflows/pr-env-deploy.yml | 50 +++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/.github/workflows/pr-env-deploy.yml b/.github/workflows/pr-env-deploy.yml index 755953b7b..23d1da44c 100644 --- a/.github/workflows/pr-env-deploy.yml +++ b/.github/workflows/pr-env-deploy.yml @@ -332,3 +332,53 @@ jobs: - name: Cleanup Environment Test Data run: make test-performance-cleanup TF_WORKSPACE_NAME=${{ needs.set-environment-id.outputs.environment_id }} + + smoke-test: + name: Run Smoke Tests + needs: [set-environment-id, deploy] + 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: Python Dependency Install + run: poetry install --no-root + + - 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: Retrieve Client Certificates + run: make truststore-pull-client ENV=dev + + - name: Configure Dev Account Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-region: eu-west-2 + role-chaining: true + role-to-assume: ${{ secrets.DEPLOY_ROLE_ARN }} + role-session-name: github-actions-ci-${{ needs.set-environment-id.outputs.environment_id }} + + - name: Smoke Test + run: | + make TF_WORKSPACE_NAME=${{ needs.set-environment-id.outputs.environment_id }} test-smoke-internal From 23095a946927b84a9872ad5553f82773c71887df Mon Sep 17 00:00:00 2001 From: eesa456 Date: Fri, 29 Nov 2024 16:03:22 +0000 Subject: [PATCH 03/12] NRL-000 add mising type display --- tests/smoke/setup.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/smoke/setup.py b/tests/smoke/setup.py index 65bd065e2..a44ebe9bb 100644 --- a/tests/smoke/setup.py +++ b/tests/smoke/setup.py @@ -1,4 +1,4 @@ -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, @@ -36,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( From 08520f225e1237ad6cc864e29a6d270aba5e12c2 Mon Sep 17 00:00:00 2001 From: eesa456 Date: Fri, 29 Nov 2024 16:07:30 +0000 Subject: [PATCH 04/12] NRL-1213 make smoke test public --- .github/workflows/pr-env-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-env-deploy.yml b/.github/workflows/pr-env-deploy.yml index 23d1da44c..1b8fbc04f 100644 --- a/.github/workflows/pr-env-deploy.yml +++ b/.github/workflows/pr-env-deploy.yml @@ -381,4 +381,4 @@ jobs: - name: Smoke Test run: | - make TF_WORKSPACE_NAME=${{ needs.set-environment-id.outputs.environment_id }} test-smoke-internal + make TF_WORKSPACE_NAME=${{ needs.set-environment-id.outputs.environment_id }} test-smoke-public From 0f71411a0ace9929efcaa2586af7dd827948c79a Mon Sep 17 00:00:00 2001 From: eesa456 Date: Fri, 29 Nov 2024 16:41:55 +0000 Subject: [PATCH 05/12] NRL-000 use pr env for smoke tests - internal --- .github/workflows/pr-env-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-env-deploy.yml b/.github/workflows/pr-env-deploy.yml index 1b8fbc04f..23d1da44c 100644 --- a/.github/workflows/pr-env-deploy.yml +++ b/.github/workflows/pr-env-deploy.yml @@ -381,4 +381,4 @@ jobs: - name: Smoke Test run: | - make TF_WORKSPACE_NAME=${{ needs.set-environment-id.outputs.environment_id }} test-smoke-public + make TF_WORKSPACE_NAME=${{ needs.set-environment-id.outputs.environment_id }} test-smoke-internal From 1f3e5028854eb69229e20b45a09bb571a9bb05bd Mon Sep 17 00:00:00 2001 From: eesa456 Date: Fri, 29 Nov 2024 16:52:34 +0000 Subject: [PATCH 06/12] NRL-000 stay on mgmt acct for smoke tests --- .github/workflows/pr-env-deploy.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/pr-env-deploy.yml b/.github/workflows/pr-env-deploy.yml index 23d1da44c..92a0a65c7 100644 --- a/.github/workflows/pr-env-deploy.yml +++ b/.github/workflows/pr-env-deploy.yml @@ -371,14 +371,6 @@ jobs: - name: Retrieve Client Certificates run: make truststore-pull-client ENV=dev - - name: Configure Dev Account Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-region: eu-west-2 - role-chaining: true - role-to-assume: ${{ secrets.DEPLOY_ROLE_ARN }} - role-session-name: github-actions-ci-${{ needs.set-environment-id.outputs.environment_id }} - - name: Smoke Test run: | make TF_WORKSPACE_NAME=${{ needs.set-environment-id.outputs.environment_id }} test-smoke-internal From 13a863eb21f65ae661a9e5f95bc152cdee6b399c Mon Sep 17 00:00:00 2001 From: eesa456 Date: Fri, 29 Nov 2024 16:53:28 +0000 Subject: [PATCH 07/12] NRL-000 run smoke tests after perf tests --- .github/workflows/pr-env-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-env-deploy.yml b/.github/workflows/pr-env-deploy.yml index 92a0a65c7..25d8cfbe0 100644 --- a/.github/workflows/pr-env-deploy.yml +++ b/.github/workflows/pr-env-deploy.yml @@ -335,7 +335,7 @@ jobs: smoke-test: name: Run Smoke Tests - needs: [set-environment-id, deploy] + needs: [set-environment-id, performance-test] environment: pull-request runs-on: [self-hosted, ci] From 515c7e784e7dbbdc95f975ac886ef0d7757ef6ad Mon Sep 17 00:00:00 2001 From: eesa456 Date: Fri, 29 Nov 2024 17:34:31 +0000 Subject: [PATCH 08/12] NRL-1213 move smoke tests up and change call --- .github/workflows/pr-env-deploy.yml | 82 ++++++++++++++--------------- 1 file changed, 40 insertions(+), 42 deletions(-) diff --git a/.github/workflows/pr-env-deploy.yml b/.github/workflows/pr-env-deploy.yml index 25d8cfbe0..56ba42efb 100644 --- a/.github/workflows/pr-env-deploy.yml +++ b/.github/workflows/pr-env-deploy.yml @@ -264,6 +264,46 @@ 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: Python Dependency Install + run: poetry install --no-root + + - 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: Smoke Test + run: | + make ENV=dev truststore-pull-client + make ENV=dev test-smoke-internal + performance-test: name: Run Performance Tests needs: [set-environment-id, integration-test] @@ -332,45 +372,3 @@ jobs: - name: Cleanup Environment Test Data run: make test-performance-cleanup TF_WORKSPACE_NAME=${{ needs.set-environment-id.outputs.environment_id }} - - smoke-test: - name: Run Smoke Tests - needs: [set-environment-id, performance-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: Python Dependency Install - run: poetry install --no-root - - - 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: Retrieve Client Certificates - run: make truststore-pull-client ENV=dev - - - name: Smoke Test - run: | - make TF_WORKSPACE_NAME=${{ needs.set-environment-id.outputs.environment_id }} test-smoke-internal From dd1e91db134b32a5bfd44af90e803ab9169e05d1 Mon Sep 17 00:00:00 2001 From: eesa456 Date: Sat, 30 Nov 2024 20:16:40 +0000 Subject: [PATCH 09/12] NRL-000 trying something --- .github/workflows/pr-env-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-env-deploy.yml b/.github/workflows/pr-env-deploy.yml index 56ba42efb..be6aa1342 100644 --- a/.github/workflows/pr-env-deploy.yml +++ b/.github/workflows/pr-env-deploy.yml @@ -302,7 +302,7 @@ jobs: - name: Smoke Test run: | make ENV=dev truststore-pull-client - make ENV=dev test-smoke-internal + make ENV=dev TF_WORKSPACE_NAME=${{ needs.set-environment-id.outputs.environment_id }} test-smoke-internal performance-test: name: Run Performance Tests From cb8d9496b97e59199267bcb9117195ed2ef8b3fa Mon Sep 17 00:00:00 2001 From: eesa456 Date: Mon, 2 Dec 2024 09:26:09 +0000 Subject: [PATCH 10/12] NRL-000 setup python env --- .github/workflows/pr-env-deploy.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-env-deploy.yml b/.github/workflows/pr-env-deploy.yml index be6aa1342..cca2d741c 100644 --- a/.github/workflows/pr-env-deploy.yml +++ b/.github/workflows/pr-env-deploy.yml @@ -289,8 +289,10 @@ jobs: with: asdf_branch: v0.13.1 - - name: Python Dependency Install - run: poetry install --no-root + - 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 @@ -306,7 +308,7 @@ jobs: performance-test: name: Run Performance Tests - needs: [set-environment-id, integration-test] + needs: [set-environment-id, smoke-test] environment: pull-request runs-on: [self-hosted, ci] From db37396ece031cdba2cb238b0826430601b774ba Mon Sep 17 00:00:00 2001 From: eesa456 Date: Mon, 2 Dec 2024 11:10:04 +0000 Subject: [PATCH 11/12] NRL-1213 comment out smoke test --- .github/workflows/pr-env-deploy.yml | 84 ++++++++++++++--------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/.github/workflows/pr-env-deploy.yml b/.github/workflows/pr-env-deploy.yml index cca2d741c..a445b1f2e 100644 --- a/.github/workflows/pr-env-deploy.yml +++ b/.github/workflows/pr-env-deploy.yml @@ -264,51 +264,51 @@ 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: 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 + # 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: 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, smoke-test] + needs: [set-environment-id, integration-test] environment: pull-request runs-on: [self-hosted, ci] From d15fcaecbdd982007caea9706ad6f6664ff82cb1 Mon Sep 17 00:00:00 2001 From: Matt Dean Date: Mon, 2 Dec 2024 15:50:13 +0000 Subject: [PATCH 12/12] [NRL-000] Fix up smoke tests to use TF to get domain --- .github/workflows/pr-env-deploy.yml | 87 +++++++++++++++-------------- 1 file changed, 46 insertions(+), 41 deletions(-) diff --git a/.github/workflows/pr-env-deploy.yml b/.github/workflows/pr-env-deploy.yml index a445b1f2e..a90419e50 100644 --- a/.github/workflows/pr-env-deploy.yml +++ b/.github/workflows/pr-env-deploy.yml @@ -264,47 +264,52 @@ 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: 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 + 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