feat(e2e): proxy real workflowui and pastebin through smoke nginx

- nginx-smoke now proxies /workflowui → host:3000 and /pastebin → host:3001
  (playwright webServer processes) instead of returning stub HTML
- extra_hosts: host.docker.internal:host-gateway lets nginx reach the
  host network on Linux (GitHub Actions ubuntu-latest)
- playwright.config.ts: added pastebin as a second webServer on PORT=3001
  (workspace: codesnippet, turbopack dev server)
- Remaining apps (codegen, emailclient, etc.) stay as stubs since they
  are not started as dev servers in CI

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-10 11:52:25 +00:00
parent 77a3824168
commit 5dd1807949
3 changed files with 66 additions and 24 deletions

View File

@@ -1,22 +1,34 @@
##
## nginx-smoke — Stub gateway for deployment smoke tests in CI.
## Serves placeholder 200 responses for all web app paths so smoke tests
## can verify routing plumbing without requiring custom-built app images.
## Real admin tool containers (phpMyAdmin, Mongo Express, RedisInsight)
## run alongside this stub on their own ports.
## nginx-smoke — Gateway for deployment smoke tests in CI.
##
## Real apps (workflowui, pastebin) are proxied to playwright's webServer
## processes running on the host (reached via host.docker.internal).
## Remaining apps (codegen, emailclient, etc.) return stub 200 responses
## since they are not started as dev servers in CI.
##
server {
listen 80;
server_name localhost;
# Portal — must contain "MetaBuilder" for the portal smoke test
location = / {
add_header Content-Type text/html;
return 200 '<html><body><h1>MetaBuilder Portal</h1></body></html>';
# ── Real apps — proxied to playwright webServer processes on host ─────
location /workflowui {
proxy_pass http://host.docker.internal:3000;
proxy_set_header Host localhost;
proxy_set_header X-Real-IP $remote_addr;
proxy_read_timeout 120s;
}
# DBAL API stubs
location /pastebin {
proxy_pass http://host.docker.internal:3001;
proxy_set_header Host localhost;
proxy_set_header X-Real-IP $remote_addr;
proxy_read_timeout 120s;
}
# ── DBAL API stubs ────────────────────────────────────────────────────
location = /api/health {
add_header Content-Type application/json;
return 200 '{"status":"ok"}';
@@ -27,12 +39,21 @@ server {
return 200 '{"version":"smoke-stub"}';
}
# Postgres dashboard — redirect (smoke test checks < 500, redirects are fine)
# ── Portal — must contain "MetaBuilder" ───────────────────────────────
location = / {
add_header Content-Type text/html;
return 200 '<html><body><h1>MetaBuilder Portal</h1></body></html>';
}
# ── Postgres redirect ─────────────────────────────────────────────────
location = /postgres {
return 307 /postgres/dashboard;
}
# All other paths — return minimal HTML with non-empty body
# ── Remaining apps — stub (codegen, emailclient, diagrams, etc.) ──────
location / {
add_header Content-Type text/html;
return 200 '<html><body>MetaBuilder App</body></html>';

View File

@@ -22,6 +22,11 @@ services:
- "80:80"
volumes:
- ./config/nginx-smoke/default.conf:/etc/nginx/conf.d/default.conf:ro
# host.docker.internal lets nginx proxy to playwright's webServer processes
# running on the host (workflowui :3000, pastebin :3001).
# On Linux (GitHub Actions) this requires the host-gateway extra_host.
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://127.0.0.1/"]
interval: 5s

View File

@@ -26,19 +26,35 @@ export default defineConfig({
screenshot: 'only-on-failure',
},
/* Start workflowui dev server automatically when not running against Docker stack */
webServer: process.env.PLAYWRIGHT_BASE_URL ? undefined : {
command: 'npm run dev -w workflowui',
url: 'http://localhost:3000/workflowui/',
reuseExistingServer: !process.env.CI,
timeout: 120_000,
env: {
NODE_ENV: 'development',
NEXT_PUBLIC_API_URL: 'http://localhost:8080',
NEXTAUTH_SECRET: 'test-secret',
NEXTAUTH_URL: 'http://localhost:3000',
/* Start dev servers automatically when not running against a live Docker stack */
webServer: process.env.PLAYWRIGHT_BASE_URL ? undefined : [
{
command: 'npm run dev -w workflowui',
url: 'http://localhost:3000/workflowui/',
reuseExistingServer: !process.env.CI,
timeout: 120_000,
env: {
NODE_ENV: 'development',
NEXT_PUBLIC_API_URL: 'http://localhost:8080',
NEXTAUTH_SECRET: 'test-secret',
NEXTAUTH_URL: 'http://localhost:3000',
},
},
},
{
command: 'PORT=3001 npm run dev -w codesnippet',
url: 'http://localhost:3001/pastebin/',
reuseExistingServer: !process.env.CI,
timeout: 120_000,
env: {
NODE_ENV: 'development',
PORT: '3001',
NEXT_PUBLIC_DBAL_API_URL: 'http://localhost:8080',
NEXT_PUBLIC_FLASK_BACKEND_URL: 'http://localhost:5000',
NEXTAUTH_SECRET: 'test-secret',
NEXTAUTH_URL: 'http://localhost:3001',
},
},
],
projects: [
{