mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 20:42:02 +00:00
refactor(e2e): remove global-setup file — Docker lifecycle handled in CI
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user