From 60b090284aabacf87c826da685a4d5ef895677a2 Mon Sep 17 00:00:00 2001 From: sumit_chaturvedi Date: Wed, 25 Jun 2025 12:39:59 +0530 Subject: [PATCH] =?UTF-8?q?refactor(e2e):=20remove=20global-setup=20file?= =?UTF-8?q?=20=E2=80=94=20Docker=20lifecycle=20handled=20in=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/playwright.config.ts | 3 --- ui/tests/e2e/global-setup.ts | 23 ----------------------- 2 files changed, 26 deletions(-) delete mode 100644 ui/tests/e2e/global-setup.ts diff --git a/ui/playwright.config.ts b/ui/playwright.config.ts index abaf3b117c..4bcc8f5620 100644 --- a/ui/playwright.config.ts +++ b/ui/playwright.config.ts @@ -12,9 +12,6 @@ export default defineConfig({ retries: isLocal ? 0 : 2, workers: isLocal ? undefined : 1, reporter: "html", - globalSetup: isLocal - ? undefined - : require.resolve("./tests/e2e/global-setup"), use: { baseURL: "http://localhost:3000", trace: "on-first-retry", diff --git a/ui/tests/e2e/global-setup.ts b/ui/tests/e2e/global-setup.ts deleted file mode 100644 index 6a1c576741..0000000000 --- a/ui/tests/e2e/global-setup.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { FullConfig } from '@playwright/test'; -import { execSync } from 'child_process'; - -async function globalSetup(config: FullConfig) { - // Start Docker containers (for CI or non-local runs) - console.log('Starting Docker containers...'); - execSync( - 'docker compose -f ../docker-compose-dev.yml up -d --build api-dev postgres valkey worker-beat worker-dev', - { stdio: 'inherit' } - ); - - // Wait for services to be ready - console.log('Waiting for services to be ready...'); - await new Promise((resolve) => setTimeout(resolve, 30000)); // Wait 30 seconds - - // Register cleanup function - process.on('exit', () => { - console.log('Cleaning up containers...'); - execSync('docker compose -f ../docker-compose-dev.yml down', { stdio: 'inherit' }); - }); -} - -export default globalSetup;