From 79184e70aff2f42f42294ef8cccdbe3aa33eafb6 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 3 Apr 2024 12:32:29 +0100 Subject: [PATCH] Remove CONTAINER_NAMESPACE, it wasn't the solution. --- .github/workflows/budibase_ci.yml | 2 -- globalSetup.ts | 6 ------ .../tests/core/utilities/testContainerUtils.ts | 12 +----------- .../server/src/integrations/tests/utils/index.ts | 6 ------ 4 files changed, 1 insertion(+), 25 deletions(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 38874b48fd..42d73ba8bb 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -94,7 +94,6 @@ jobs: env: DEBUG: testcontainers,testcontainers:exec,testcontainers:build,testcontainers:pull REUSE_CONTAINERS: true - CONTAINER_NAMESPACE: test-libraries steps: - name: Checkout repo uses: actions/checkout@v4 @@ -154,7 +153,6 @@ jobs: env: DEBUG: testcontainers,testcontainers:exec,testcontainers:build,testcontainers:pull REUSE_CONTAINERS: true - CONTAINER_NAMESPACE: test-server steps: - name: Checkout repo uses: actions/checkout@v4 diff --git a/globalSetup.ts b/globalSetup.ts index 0d0ec25bf8..7bf5e2152c 100644 --- a/globalSetup.ts +++ b/globalSetup.ts @@ -38,12 +38,6 @@ export default async function setup() { couchdb = couchdb.withReuse() } - if (process.env.CONTAINER_NAMESPACE) { - couchdb = couchdb.withLabels({ - "org.testcontainers.namespace": process.env.CONTAINER_NAMESPACE, - }) - } - await couchdb.start() } finally { if (process.env.REUSE_CONTAINERS) { diff --git a/packages/backend-core/tests/core/utilities/testContainerUtils.ts b/packages/backend-core/tests/core/utilities/testContainerUtils.ts index eeb9d7e6d3..951a6f0517 100644 --- a/packages/backend-core/tests/core/utilities/testContainerUtils.ts +++ b/packages/backend-core/tests/core/utilities/testContainerUtils.ts @@ -23,22 +23,12 @@ function getTestcontainers(): ContainerInfo[] { // We use --format json to make sure the output is nice and machine-readable, // and we use --no-trunc so that the command returns full container IDs so we // can filter on them correctly. - let containers = execSync("docker ps --format json --no-trunc") + return execSync("docker ps --format json --no-trunc") .toString() .split("\n") .filter(x => x.length > 0) .map(x => JSON.parse(x) as ContainerInfo) .filter(x => x.Labels.includes("org.testcontainers=true")) - - if (process.env.CONTAINER_NAMESPACE) { - containers = containers.filter(x => - x.Labels.includes( - `org.testcontainers.namespace=${process.env.CONTAINER_NAMESPACE}` - ) - ) - } - - return containers } export function getContainerByImage(image: string) { diff --git a/packages/server/src/integrations/tests/utils/index.ts b/packages/server/src/integrations/tests/utils/index.ts index 3286f9a3b8..bbdb41b38a 100644 --- a/packages/server/src/integrations/tests/utils/index.ts +++ b/packages/server/src/integrations/tests/utils/index.ts @@ -67,12 +67,6 @@ export async function rawQuery(ds: Datasource, sql: string): Promise { } export async function startContainer(container: GenericContainer) { - if (process.env.CONTAINER_NAMESPACE) { - container = container.withLabels({ - "org.testcontainers.namespace": process.env.CONTAINER_NAMESPACE, - }) - } - if (process.env.REUSE_CONTAINERS) { container = container.withReuse() }