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:
2026-03-10 11:15:52 +00:00
parent d61736d081
commit 34a8b7b75e

View File

@@ -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 = [