From 9c0f19b479ef06016a3e3b53bfc50bfe9ef2f85c Mon Sep 17 00:00:00 2001 From: "scott.fullerton1" Date: Thu, 30 Apr 2026 09:33:47 +0100 Subject: [PATCH 1/9] CCM-15276: Updated test for nonprod --- tests/playwright/config/component/senders.setup.ts | 3 ++- tests/playwright/constants/tests-constants.ts | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/playwright/config/component/senders.setup.ts b/tests/playwright/config/component/senders.setup.ts index 43fb2addb..26f142f5b 100644 --- a/tests/playwright/config/component/senders.setup.ts +++ b/tests/playwright/config/component/senders.setup.ts @@ -2,6 +2,7 @@ import { test as setup } from '@playwright/test'; import senderRepository from 'helpers/sender-helpers'; import { Sender } from 'utils'; import { + ROUTING_CONFIG_ID, SENDER_ID_SKIPS_NOTIFY, SENDER_ID_THAT_TRIGGERS_ERROR_IN_NOTIFY_SANDBOX, SENDER_ID_VALID_FOR_NOTIFY_SANDBOX, @@ -20,7 +21,7 @@ const testSenders: Sender[] = [ senderName: 'componentTestSender_RoutingConfig', meshMailboxSenderId: 'meshMailboxSender1', meshMailboxReportsId: 'meshMailboxReports1', - routingConfigId: 'b838b13c-f98c-4def-93f0-515d4e4f4ee1', + routingConfigId: ROUTING_CONFIG_ID, fallbackWaitTimeSeconds: 100, }, { diff --git a/tests/playwright/constants/tests-constants.ts b/tests/playwright/constants/tests-constants.ts index 9cd18aef5..119dbd692 100644 --- a/tests/playwright/constants/tests-constants.ts +++ b/tests/playwright/constants/tests-constants.ts @@ -14,14 +14,16 @@ export const EXISTING_SENDER_IDS = [ ]; export const ENVIRONMENT_SPECIFIC_CONSTANTS = { - // Suppliers Dev Account + // Suppliers Dev Account (Sandbox) '820178564574': { nhsAppBaseUrl: 'https://example.com', + routingConfigId: 'b838b13c-f98c-4def-93f0-515d4e4f4ee1', }, - // Suppliers Non Prod Account + // Suppliers Non Prod Account (Int) '885964308133': { nhsAppBaseUrl: 'https://www-onboardingaos.nhsapp.service.nhs.uk', + routingConfigId: 'c940a9ce-e70d-4986-8046-afd168b39738', }, }; @@ -29,3 +31,8 @@ export const NHS_APP_BASE_URL = ENVIRONMENT_SPECIFIC_CONSTANTS[ AWS_ACCOUNT_ID_SAFE as keyof typeof ENVIRONMENT_SPECIFIC_CONSTANTS ].nhsAppBaseUrl; + +export const ROUTING_CONFIG_ID = + ENVIRONMENT_SPECIFIC_CONSTANTS[ + AWS_ACCOUNT_ID_SAFE as keyof typeof ENVIRONMENT_SPECIFIC_CONSTANTS + ].routingConfigId; From f7ce6c273a5c1fc196006a019440c78ebe819bc2 Mon Sep 17 00:00:00 2001 From: "scott.fullerton1" Date: Fri, 1 May 2026 14:33:34 +0100 Subject: [PATCH 2/9] CCM-15276: Update core notify test --- .../core-notify.component.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts b/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts index 1d2a42d47..d4af09360 100644 --- a/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts +++ b/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts @@ -76,7 +76,8 @@ test.describe('Digital Letters - Core Notify', () => { CORE_NOTIFIER_LAMBDA_LOG_GROUP_NAME, [ '$.message.description = "Successfully processed request and sent to Notify"', - `$.message.messageReference = "${SENDER_ID_VALID_FOR_NOTIFY_SANDBOX}_${messageReference}"`, + `$.message.messageReference = "${messageReference}"`, + `$.message.senderId = "${SENDER_ID_VALID_FOR_NOTIFY_SANDBOX}"`, ], ); From 49b31b743c01ce5b4adeb572b78cde48ab9f775b Mon Sep 17 00:00:00 2001 From: "scott.fullerton1" Date: Tue, 5 May 2026 11:28:10 +0100 Subject: [PATCH 3/9] CCM-15276: Update core test --- .../core-notify.component.spec.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts b/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts index d4af09360..1d2a42d47 100644 --- a/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts +++ b/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts @@ -76,8 +76,7 @@ test.describe('Digital Letters - Core Notify', () => { CORE_NOTIFIER_LAMBDA_LOG_GROUP_NAME, [ '$.message.description = "Successfully processed request and sent to Notify"', - `$.message.messageReference = "${messageReference}"`, - `$.message.senderId = "${SENDER_ID_VALID_FOR_NOTIFY_SANDBOX}"`, + `$.message.messageReference = "${SENDER_ID_VALID_FOR_NOTIFY_SANDBOX}_${messageReference}"`, ], ); From bc41b066a53ca5a6a6266d17fe07e749d3a505f5 Mon Sep 17 00:00:00 2001 From: "scott.fullerton1" Date: Wed, 6 May 2026 15:49:55 +0100 Subject: [PATCH 4/9] CCM-15276: Increase timeout on test --- tests/playwright/constants/tests-constants.ts | 4 ++-- .../core-notify.component.spec.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/playwright/constants/tests-constants.ts b/tests/playwright/constants/tests-constants.ts index 119dbd692..054d901b3 100644 --- a/tests/playwright/constants/tests-constants.ts +++ b/tests/playwright/constants/tests-constants.ts @@ -14,13 +14,13 @@ export const EXISTING_SENDER_IDS = [ ]; export const ENVIRONMENT_SPECIFIC_CONSTANTS = { - // Suppliers Dev Account (Sandbox) + // Suppliers Dev Account '820178564574': { nhsAppBaseUrl: 'https://example.com', routingConfigId: 'b838b13c-f98c-4def-93f0-515d4e4f4ee1', }, - // Suppliers Non Prod Account (Int) + // Suppliers Non Prod Account '885964308133': { nhsAppBaseUrl: 'https://www-onboardingaos.nhsapp.service.nhs.uk', routingConfigId: 'c940a9ce-e70d-4986-8046-afd168b39738', diff --git a/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts b/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts index 1d2a42d47..cfcc22659 100644 --- a/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts +++ b/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts @@ -192,7 +192,7 @@ test.describe('Digital Letters - Core Notify', () => { }); test('given PDMResourceAvailable event, when client does NOT exist then it goes to DLQ', async () => { - test.setTimeout(250_000); + test.setTimeout(360_000); const eventId = uuidv4(); const messageReference = uuidv4(); @@ -224,7 +224,7 @@ test.describe('Digital Letters - Core Notify', () => { expect(filteredLogs.length).toBeGreaterThanOrEqual(1); }, 240), // Verify there is a message in the DLQ - expectMessageContainingString(CORE_NOTIFIER_DLQ_NAME, eventId, 240), + expectMessageContainingString(CORE_NOTIFIER_DLQ_NAME, eventId, 350), ]); }); }); From 4f0db036b3f442552275d143f9633900139502ec Mon Sep 17 00:00:00 2001 From: "scott.fullerton1" Date: Wed, 6 May 2026 15:53:27 +0100 Subject: [PATCH 5/9] CCM-15276: gitleaksignore --- .gitleaksignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitleaksignore b/.gitleaksignore index b047cedea..400b9a8fe 100644 --- a/.gitleaksignore +++ b/.gitleaksignore @@ -18,3 +18,4 @@ d1c0a37078cbed4fbedae044e5cbafac71717af0:utils/utils/src/__tests__/key-generatio d1c0a37078cbed4fbedae044e5cbafac71717af0:utils/utils/src/__tests__/key-generation/get-private-key.test.ts:private-key:46 f0eebf1356a699213340a45f64c6b990afcbb869:infrastructure/terraform/components/dl/ssm_parameter_mesh.tf:hashicorp-tf-password:11 e75d9e202c1fad2c9591c4fe0e411194bf19c8f6:infrastructure/terraform/components/dl/ssm_parameter_mesh_config.tf:hashicorp-tf-password:11 +72c1f9356ce8773949204e60b6f787d667b1bd2b:utils/utils/src/__tests__/key-generation-utils/jwk-key.test.ts:private-key:3 From 2331be741a9cfb96ec994e79c58f3011f020b5cc Mon Sep 17 00:00:00 2001 From: "scott.fullerton1" Date: Thu, 7 May 2026 08:39:51 +0100 Subject: [PATCH 6/9] CCM-15276: Update core notifier test for batches --- .../core-notify.component.spec.ts | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts b/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts index cfcc22659..e5ca90f32 100644 --- a/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts +++ b/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts @@ -192,7 +192,7 @@ test.describe('Digital Letters - Core Notify', () => { }); test('given PDMResourceAvailable event, when client does NOT exist then it goes to DLQ', async () => { - test.setTimeout(360_000); + test.setTimeout(250_000); const eventId = uuidv4(); const messageReference = uuidv4(); @@ -213,18 +213,20 @@ test.describe('Digital Letters - Core Notify', () => { validatePDMResourceAvailable, ); - await Promise.all([ - // Verify the event is processed and a message appears in the Lambda logs - expectToPassEventually(async () => { - const filteredLogs = await getLogsFromCloudwatch( - CORE_NOTIFIER_LAMBDA_LOG_GROUP_NAME, - ['$.message.description = "0 of 1 records processed successfully"'], - ); - - expect(filteredLogs.length).toBeGreaterThanOrEqual(1); - }, 240), - // Verify there is a message in the DLQ - expectMessageContainingString(CORE_NOTIFIER_DLQ_NAME, eventId, 350), - ]); + // Verify the event is processed and a message appears in the Lambda logs + await expectToPassEventually(async () => { + const filteredLogs = await getLogsFromCloudwatch( + CORE_NOTIFIER_LAMBDA_LOG_GROUP_NAME, + [ + '$.message.description = "Failed processing message"', + '$.message.error = "Sender not found for senderId: senderId_that_does_not_exist"', + ], + ); + + expect(filteredLogs.length).toBeGreaterThanOrEqual(1); + }, 240); + + // Verify there is a message in the DLQ + await expectMessageContainingString(CORE_NOTIFIER_DLQ_NAME, eventId, 240); }); }); From f7ba2345d6027a7c866d329d254d90af94d81c52 Mon Sep 17 00:00:00 2001 From: "scott.fullerton1" Date: Thu, 7 May 2026 11:03:22 +0100 Subject: [PATCH 7/9] CCM-15276: Update timeout --- .../core-notify.component.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts b/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts index e5ca90f32..99e0bf144 100644 --- a/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts +++ b/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts @@ -192,7 +192,7 @@ test.describe('Digital Letters - Core Notify', () => { }); test('given PDMResourceAvailable event, when client does NOT exist then it goes to DLQ', async () => { - test.setTimeout(250_000); + test.setTimeout(360_000); const eventId = uuidv4(); const messageReference = uuidv4(); @@ -227,6 +227,6 @@ test.describe('Digital Letters - Core Notify', () => { }, 240); // Verify there is a message in the DLQ - await expectMessageContainingString(CORE_NOTIFIER_DLQ_NAME, eventId, 240); + await expectMessageContainingString(CORE_NOTIFIER_DLQ_NAME, eventId, 300); }); }); From 083f2a839c95b4d117f60dca1f2b228c9572e9fe Mon Sep 17 00:00:00 2001 From: "scott.fullerton1" Date: Wed, 13 May 2026 13:25:28 +0100 Subject: [PATCH 8/9] CCM-15276: Added messageReference --- .../src/__tests__/apis/sqs-handler.test.ts | 4 ++++ lambdas/core-notifier-lambda/src/apis/sqs-handler.ts | 1 + tests/playwright/constants/tests-constants.ts | 11 +++++------ .../core-notify.component.spec.ts | 1 + 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lambdas/core-notifier-lambda/src/__tests__/apis/sqs-handler.test.ts b/lambdas/core-notifier-lambda/src/__tests__/apis/sqs-handler.test.ts index fd7046aad..c19446a44 100644 --- a/lambdas/core-notifier-lambda/src/__tests__/apis/sqs-handler.test.ts +++ b/lambdas/core-notifier-lambda/src/__tests__/apis/sqs-handler.test.ts @@ -155,6 +155,7 @@ describe('createHandler', () => { description: 'Failed processing message', messageId: sqsEvent.Records[0].messageId, senderId: validSender.senderId, + messageReference, }), ); }); @@ -227,6 +228,7 @@ describe('createHandler', () => { description: 'Failed processing message', messageId, senderId: undefined, + messageReference: undefined, }); expect(mockLogger.info).toHaveBeenCalledWith({ description: '0 of 1 records processed successfully', @@ -257,6 +259,7 @@ describe('createHandler', () => { description: 'Failed processing message', messageId, senderId: validSender.senderId, + messageReference, }); expect( mockEventPublisher.sendEvents, @@ -301,6 +304,7 @@ describe('createHandler', () => { description: 'Failed processing message', messageId, senderId: validSender.senderId, + messageReference, }); expect(mockEventPublisher.sendEvents).toHaveBeenCalledTimes(1); expect(mockEventPublisher.sendEvents).toHaveBeenCalledWith( diff --git a/lambdas/core-notifier-lambda/src/apis/sqs-handler.ts b/lambdas/core-notifier-lambda/src/apis/sqs-handler.ts index 015beff3e..591278f95 100644 --- a/lambdas/core-notifier-lambda/src/apis/sqs-handler.ts +++ b/lambdas/core-notifier-lambda/src/apis/sqs-handler.ts @@ -128,6 +128,7 @@ async function processSqsRecord( description: 'Failed processing message', messageId: sqsRecord.messageId, senderId: incoming?.data.senderId, + messageReference: incoming?.data.messageReference, }); if (error instanceof RequestNotifyError && incoming && sender) { diff --git a/tests/playwright/constants/tests-constants.ts b/tests/playwright/constants/tests-constants.ts index 054d901b3..7d2d40f8c 100644 --- a/tests/playwright/constants/tests-constants.ts +++ b/tests/playwright/constants/tests-constants.ts @@ -27,12 +27,11 @@ export const ENVIRONMENT_SPECIFIC_CONSTANTS = { }, }; -export const NHS_APP_BASE_URL = +const ENVIRONMENT_CONFIG = ENVIRONMENT_SPECIFIC_CONSTANTS[ AWS_ACCOUNT_ID_SAFE as keyof typeof ENVIRONMENT_SPECIFIC_CONSTANTS - ].nhsAppBaseUrl; + ]; -export const ROUTING_CONFIG_ID = - ENVIRONMENT_SPECIFIC_CONSTANTS[ - AWS_ACCOUNT_ID_SAFE as keyof typeof ENVIRONMENT_SPECIFIC_CONSTANTS - ].routingConfigId; +export const NHS_APP_BASE_URL = ENVIRONMENT_CONFIG.nhsAppBaseUrl; + +export const ROUTING_CONFIG_ID = ENVIRONMENT_CONFIG.routingConfigId; diff --git a/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts b/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts index 99e0bf144..c653803af 100644 --- a/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts +++ b/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts @@ -220,6 +220,7 @@ test.describe('Digital Letters - Core Notify', () => { [ '$.message.description = "Failed processing message"', '$.message.error = "Sender not found for senderId: senderId_that_does_not_exist"', + `$.message.messageReference = "${messageReference}"`, ], ); From de0ed8599e6e5dc5320196d7e11f356eb7306ea9 Mon Sep 17 00:00:00 2001 From: "scott.fullerton1" Date: Wed, 13 May 2026 14:03:34 +0100 Subject: [PATCH 9/9] CCM-15276: Fix sharding failures --- .github/actions/acceptance-tests/action.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/actions/acceptance-tests/action.yaml b/.github/actions/acceptance-tests/action.yaml index d6735f77a..e063dab6b 100644 --- a/.github/actions/acceptance-tests/action.yaml +++ b/.github/actions/acceptance-tests/action.yaml @@ -77,9 +77,16 @@ runs: TEST_TYPE: ${{ inputs.testType }} ENVIRONMENT: ${{ inputs.targetEnvironment }} PLAYWRIGHT_SHARD: ${{ inputs.shard }} + - name: Sanitise shard for artifact name + id: shard_label + if: ${{ inputs.testType == 'integration' && inputs.shard != '' }} + shell: bash + run: echo "value=${SHARD//\// of }" >> $GITHUB_OUTPUT + env: + SHARD: ${{ inputs.shard }} - name: Archive integration test results if: ${{ inputs.testType == 'integration' }} uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 with: - name: Integration test report + name: Integration test report${{ inputs.shard != '' && format(' ({0})', steps.shard_label.outputs.value) || '' }} path: "tests/playwright/playwright-report"