Skip to content

Commit d118018

Browse files
improve test order, log, and retries
1 parent 49ad3bc commit d118018

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

tests/component-tests/events-tests/event-subscription.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ test.describe("Event Subscription SNS Tests", () => {
4141
supplierAllocatorLog.msg?.allocationDetails?.supplierSpec?.supplierId;
4242

4343
logger.info(
44-
`Supplier ${supplierId} allocated for domainId ${domainId} in supplier allocator lambda`,
44+
`Supplier ${supplierId} allocated to letter ${domainId} in supplier allocator lambda`,
4545
);
4646
if (!supplierId) {
4747
throw new Error("supplierId was not found in supplier allocator log");
@@ -109,7 +109,7 @@ test.describe("Event Subscription SNS Tests", () => {
109109
supplierAllocatorLog.msg?.allocationDetails?.supplierSpec?.supplierId;
110110

111111
logger.info(
112-
`Supplier ${supplierId} allocated for domainId ${domainId} in supplier allocator lambda`,
112+
`Supplier ${supplierId} allocated to letter ${domainId} in supplier allocator lambda`,
113113
);
114114
if (!supplierId) {
115115
throw new Error("supplierId was not found in supplier allocator log");

tests/config/main.config.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ const localConfig: PlaywrightTestConfig = {
99
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
1010
reporter: getReporters("api-test"),
1111
projects: [
12+
{
13+
name: "integration-tests",
14+
testDir: path.resolve(__dirname, "../component-tests/integration-tests"),
15+
testMatch: "**/*.spec.ts",
16+
},
1217
{
1318
name: "apiGateway-tests",
1419
testDir: path.resolve(__dirname, "../component-tests/apiGateway-tests"),
@@ -22,15 +27,10 @@ const localConfig: PlaywrightTestConfig = {
2227
dependencies: ["apiGateway-tests"],
2328
},
2429
{
25-
name: "letterQueue-tests",
30+
name: "letterQueue-tests", // Needs to run last as tests visibility timeout and can impact other tests if run before them
2631
testDir: path.resolve(__dirname, "../component-tests/letterQueue-tests"),
2732
testMatch: "**/*.spec.ts",
28-
dependencies: ["apiGateway-tests"],
29-
},
30-
{
31-
name: "integration-tests",
32-
testDir: path.resolve(__dirname, "../component-tests/integration-tests"),
33-
testMatch: "**/*.spec.ts",
33+
dependencies: ["events-tests"],
3434
},
3535
],
3636
};

tests/helpers/aws-cloudwatch-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export async function supplierIdFromSupplierAllocatorLog(
105105
supplierAllocatorLog.msg?.allocationDetails?.supplierSpec?.supplierId;
106106

107107
logger.info(
108-
`Supplier ${supplierId} allocated for domainId ${domainId} in supplier allocator lambda`,
108+
`Supplier ${supplierId} allocated to letter ${domainId} in supplier allocator lambda`,
109109
);
110110

111111
if (!supplierId) {

tests/helpers/poll-for-letters-helper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ export async function pollForLetterStatus(
1212
const headers = createValidRequestHeaders(supplierId);
1313
let statusCode = 0;
1414
let letterStatus: string | undefined;
15-
const RETRY_DELAY_MS = 10_000;
16-
const MAX_ATTEMPTS = 6;
15+
const RETRY_DELAY_MS = 15_000;
16+
const MAX_ATTEMPTS = 5;
1717

1818
for (let attempt = 1; attempt <= MAX_ATTEMPTS; attempt++) {
1919
const getLetterResponse = await request.get(

0 commit comments

Comments
 (0)