From 6249f41bbb38989f4cd75d394f43fcf2405bacea Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 30 Aug 2024 17:34:10 +0100 Subject: [PATCH] Make sure Lucene correctly sets environment variables in development tests. --- packages/server/src/api/routes/tests/search.spec.ts | 6 +++++- packages/server/src/api/routes/tests/viewV2.spec.ts | 6 +++++- .../server/src/sdk/app/rows/search/tests/search.spec.ts | 6 +++++- .../worker/src/api/routes/global/tests/auditLogs.spec.ts | 4 +++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/packages/server/src/api/routes/tests/search.spec.ts b/packages/server/src/api/routes/tests/search.spec.ts index 7ac6840be1..4b8c3eb5a1 100644 --- a/packages/server/src/api/routes/tests/search.spec.ts +++ b/packages/server/src/api/routes/tests/search.spec.ts @@ -68,7 +68,11 @@ describe.each([ beforeAll(async () => { await withCoreEnv({ TENANT_FEATURE_FLAGS: "*:SQS" }, () => config.init()) - if (isSqs) { + if (isLucene) { + envCleanup = setCoreEnv({ + TENANT_FEATURE_FLAGS: "*:!SQS", + }) + } else if (isSqs) { envCleanup = setCoreEnv({ TENANT_FEATURE_FLAGS: "*:SQS", }) diff --git a/packages/server/src/api/routes/tests/viewV2.spec.ts b/packages/server/src/api/routes/tests/viewV2.spec.ts index 83ab09cf6d..356f01dee0 100644 --- a/packages/server/src/api/routes/tests/viewV2.spec.ts +++ b/packages/server/src/api/routes/tests/viewV2.spec.ts @@ -97,7 +97,11 @@ describe.each([ await withCoreEnv({ TENANT_FEATURE_FLAGS: isSqs ? "*:SQS" : "" }, () => config.init() ) - if (isSqs) { + if (isLucene) { + envCleanup = setCoreEnv({ + TENANT_FEATURE_FLAGS: "*:!SQS", + }) + } else if (isSqs) { envCleanup = setCoreEnv({ TENANT_FEATURE_FLAGS: "*:SQS", }) diff --git a/packages/server/src/sdk/app/rows/search/tests/search.spec.ts b/packages/server/src/sdk/app/rows/search/tests/search.spec.ts index 558725c1ed..e7fd095865 100644 --- a/packages/server/src/sdk/app/rows/search/tests/search.spec.ts +++ b/packages/server/src/sdk/app/rows/search/tests/search.spec.ts @@ -45,7 +45,11 @@ describe.each([ config.init() ) - if (isSqs) { + if (isLucene) { + envCleanup = setCoreEnv({ + TENANT_FEATURE_FLAGS: "*:!SQS", + }) + } else if (isSqs) { envCleanup = setCoreEnv({ TENANT_FEATURE_FLAGS: "*:SQS", }) diff --git a/packages/worker/src/api/routes/global/tests/auditLogs.spec.ts b/packages/worker/src/api/routes/global/tests/auditLogs.spec.ts index 350c9a7edc..b09c27762d 100644 --- a/packages/worker/src/api/routes/global/tests/auditLogs.spec.ts +++ b/packages/worker/src/api/routes/global/tests/auditLogs.spec.ts @@ -17,7 +17,9 @@ describe.each(["lucene", "sql"])("/api/global/auditlogs (%s)", method => { let envCleanup: (() => void) | undefined beforeAll(async () => { - if (method === "sql") { + if (method === "lucene") { + envCleanup = setCoreEnv({ TENANT_FEATURE_FLAGS: "*:!SQS" }) + } else if (method === "sql") { envCleanup = setCoreEnv({ TENANT_FEATURE_FLAGS: "*:SQS" }) } await config.beforeAll()