mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
Replace manual docker compose start/stop in the CI workflow with Testcontainers in Playwright global setup/teardown. This gives: - Automatic container lifecycle tied to the test run - Health-check-based wait strategies per service - Clean teardown even on test failures - No CI workflow coupling to Docker orchestration Changes: - e2e/global.setup.ts: Start smoke stack via DockerComposeEnvironment (nginx, phpMyAdmin, Mongo Express, RedisInsight) with health check waits - e2e/global.teardown.ts: New file — stops Testcontainers environment - e2e/playwright.config.ts: Register globalSetup/globalTeardown, bind dev servers to 0.0.0.0 in CI so nginx can proxy via host.docker.internal - gated-pipeline.yml: Remove docker compose start/stop/verify steps, add 10min timeout to Playwright step - e2e/deployment-smoke.spec.ts: Update doc comment - package.json: Add testcontainers@^11.12.0 devDependency https://claude.ai/code/session_018rmhuicK7L7jV2YBJDXiQz
19 lines
472 B
TypeScript
19 lines
472 B
TypeScript
/**
|
|
* Playwright global teardown
|
|
* Stops the Testcontainers smoke stack started in global.setup.ts
|
|
*/
|
|
|
|
async function globalTeardown() {
|
|
const environment = (globalThis as Record<string, unknown>).__TESTCONTAINERS_ENV__ as
|
|
| { down: () => Promise<void> }
|
|
| undefined
|
|
|
|
if (environment) {
|
|
console.log('[teardown] Stopping smoke stack...')
|
|
await environment.down()
|
|
console.log('[teardown] Smoke stack stopped')
|
|
}
|
|
}
|
|
|
|
export default globalTeardown
|