From 3e2010fb264fd2008a19f246b15ebf4320362fe8 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 18 Aug 2023 14:18:47 +0100 Subject: [PATCH 1/4] Attempting to improve on test flakiness, don't depend on a timeout for docker startup, wait for port to respond. --- jestTestcontainersConfigGenerator.js | 27 +++++++++++++++---- .../core/utilities/testContainerUtils.ts | 21 +++------------ 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/jestTestcontainersConfigGenerator.js b/jestTestcontainersConfigGenerator.js index 4b94cf5016..4b8afe327d 100644 --- a/jestTestcontainersConfigGenerator.js +++ b/jestTestcontainersConfigGenerator.js @@ -1,9 +1,26 @@ module.exports = () => { return { - dockerCompose: { - composeFilePath: "../../hosting", - composeFile: "docker-compose.test.yaml", - startupTimeout: 10000, - }, + couchdb: { + image: "budibase/couchdb", + ports: [5984], + env: { + COUCHDB_PASSWORD: "budibase", + COUCHDB_USER: "budibase", + }, + wait: { + type: "ports", + timeout: 10000, + } + } } } + +// module.exports = () => { +// return { +// dockerCompose: { +// composeFilePath: "../../hosting", +// composeFile: "docker-compose.test.yaml", +// startupTimeout: 10000, +// }, +// } +// } diff --git a/packages/backend-core/tests/core/utilities/testContainerUtils.ts b/packages/backend-core/tests/core/utilities/testContainerUtils.ts index f6c702f7ef..7da6cbc777 100644 --- a/packages/backend-core/tests/core/utilities/testContainerUtils.ts +++ b/packages/backend-core/tests/core/utilities/testContainerUtils.ts @@ -32,8 +32,8 @@ function getTestContainerSettings( ): string | null { const entry = Object.entries(global).find( ([k]) => - k.includes(`_${serverName.toUpperCase()}`) && - k.includes(`_${key.toUpperCase()}__`) + k.includes(`${serverName.toUpperCase()}`) && + k.includes(`${key.toUpperCase()}`) ) if (!entry) { return null @@ -67,27 +67,14 @@ function getContainerInfo(containerName: string, port: number) { } function getCouchConfig() { - return getContainerInfo("couchdb-service", 5984) -} - -function getMinioConfig() { - return getContainerInfo("minio-service", 9000) -} - -function getRedisConfig() { - return getContainerInfo("redis-service", 6379) + return getContainerInfo("couchdb", 5984) } export function setupEnv(...envs: any[]) { - const couch = getCouchConfig(), - minio = getCouchConfig(), - redis = getRedisConfig() + const couch = getCouchConfig() const configs = [ { key: "COUCH_DB_PORT", value: couch.port }, { key: "COUCH_DB_URL", value: couch.url }, - { key: "MINIO_PORT", value: minio.port }, - { key: "MINIO_URL", value: minio.url }, - { key: "REDIS_URL", value: redis.url }, ] for (const config of configs.filter(x => !!x.value)) { From f4ba5c9382c70db4037fe2ded6edd9120ea46ee4 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 18 Aug 2023 15:07:01 +0100 Subject: [PATCH 2/4] Updating pro reference. --- packages/pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pro b/packages/pro index 9b9c8cc08f..06a28b18a4 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit 9b9c8cc08f271bfc5dd401860f344f6eb336ab35 +Subproject commit 06a28b18a409cc12e9e8a5b69a094adcc6babd5a From 3b19c8410fedbb6a5b62f971a117d4d8cf5ea47d Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 21 Aug 2023 15:31:35 +0100 Subject: [PATCH 3/4] Comments. --- packages/server/src/app.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/server/src/app.ts b/packages/server/src/app.ts index 1f38448efb..4b501718a8 100644 --- a/packages/server/src/app.ts +++ b/packages/server/src/app.ts @@ -20,11 +20,13 @@ import { startup } from "./startup" let app: Koa, server: Server async function start() { + // if API disabled, could run automations instead if (apiEnabled()) { const koa = createKoaApp() app = koa.app server = koa.server } + // startup includes automation runner - if enabled await startup(app, server) if (env.isProd()) { env._set("NODE_ENV", "production") From cf1281780d4e21451403ae45b3275ad9d12dc58a Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 21 Aug 2023 15:39:36 +0000 Subject: [PATCH 4/4] Bump version to 2.9.30-alpha.9 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index a423f99697..a5b5a4a968 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.30-alpha.8", + "version": "2.9.30-alpha.9", "npmClient": "yarn", "packages": [ "packages/*"