mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
fix(e2e): skip deployment smoke tests when Docker stack is unavailable
Added beforeAll connectivity check — tests auto-skip in CI or local dev when the nginx gateway on port 80 is unreachable, preventing ECONNREFUSED failures in environments without the full stack running. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,10 +3,35 @@ import { test, expect } from '@playwright/test'
|
||||
/**
|
||||
* Deployment smoke tests — validates all services are reachable
|
||||
* through the nginx gateway on port 80.
|
||||
*
|
||||
* These tests require the full Docker stack to be running.
|
||||
* They are skipped automatically when the gateway is unreachable
|
||||
* (e.g. in CI without the stack, or in local dev without docker compose up).
|
||||
*
|
||||
* To run locally:
|
||||
* cd deployment && docker compose -f docker-compose.stack.yml up -d
|
||||
* PLAYWRIGHT_BASE_URL=http://localhost/workflowui/ npx playwright test deployment-smoke
|
||||
*/
|
||||
|
||||
const GATEWAY = 'http://localhost'
|
||||
|
||||
let stackAvailable = false
|
||||
|
||||
test.beforeAll(async ({ request }) => {
|
||||
try {
|
||||
const resp = await request.get(GATEWAY, { timeout: 5000 })
|
||||
stackAvailable = resp.ok()
|
||||
} catch {
|
||||
stackAvailable = false
|
||||
}
|
||||
})
|
||||
|
||||
test.beforeEach(async ({}, testInfo) => {
|
||||
if (!stackAvailable) {
|
||||
testInfo.skip()
|
||||
}
|
||||
})
|
||||
|
||||
test.describe('Deployment Smoke Tests', () => {
|
||||
test.describe('Web Applications', () => {
|
||||
const apps = [
|
||||
|
||||
Reference in New Issue
Block a user