test: oprava Playwright testů
CI / Generate TypeScript types (push) Successful in 10s
CI / Server unit tests (push) Successful in 21s
CI / Build server (push) Successful in 24s
CI / Build client (push) Successful in 33s
CI / Playwright E2E tests (push) Successful in 1m17s
CI / Build and push Docker image (push) Successful in 43s
CI / Notify (push) Successful in 2s
CI / Generate TypeScript types (push) Successful in 10s
CI / Server unit tests (push) Successful in 21s
CI / Build server (push) Successful in 24s
CI / Build client (push) Successful in 33s
CI / Playwright E2E tests (push) Successful in 1m17s
CI / Build and push Docker image (push) Successful in 43s
CI / Notify (push) Successful in 2s
This commit is contained in:
@@ -4,7 +4,10 @@ import path from 'path';
|
|||||||
// Use 127.0.0.1 explicitly — on Node.js 18+/Windows, `localhost` may resolve to ::1
|
// Use 127.0.0.1 explicitly — on Node.js 18+/Windows, `localhost` may resolve to ::1
|
||||||
// (IPv6) while the HTTP server only binds to 0.0.0.0 (IPv4), causing the webServer
|
// (IPv6) while the HTTP server only binds to 0.0.0.0 (IPv4), causing the webServer
|
||||||
// readiness poll to time out even though the server is listening.
|
// readiness poll to time out even though the server is listening.
|
||||||
const BASE_URL = process.env.E2E_BASE_URL ?? 'http://127.0.0.1:3001';
|
// Port 3099 avoids conflicts with locally running Docker containers on 3001-3003.
|
||||||
|
// Override with E2E_PORT env var if needed.
|
||||||
|
const E2E_PORT = process.env.E2E_PORT ?? '3099';
|
||||||
|
const BASE_URL = process.env.E2E_BASE_URL ?? `http://127.0.0.1:${E2E_PORT}`;
|
||||||
|
|
||||||
// Server env vars injected for local runs. In CI these are set at the step level.
|
// Server env vars injected for local runs. In CI these are set at the step level.
|
||||||
const serverEnv: Record<string, string> = {
|
const serverEnv: Record<string, string> = {
|
||||||
@@ -15,6 +18,7 @@ const serverEnv: Record<string, string> = {
|
|||||||
HTTP_REMOTE_USER_ENABLED: 'true',
|
HTTP_REMOTE_USER_ENABLED: 'true',
|
||||||
HTTP_REMOTE_USER_HEADER_NAME: 'remote-user',
|
HTTP_REMOTE_USER_HEADER_NAME: 'remote-user',
|
||||||
HTTP_REMOTE_TRUSTED_IPS: process.env.HTTP_REMOTE_TRUSTED_IPS ?? '127.0.0.1,::1,::ffff:127.0.0.1',
|
HTTP_REMOTE_TRUSTED_IPS: process.env.HTTP_REMOTE_TRUSTED_IPS ?? '127.0.0.1,::1,::ffff:127.0.0.1',
|
||||||
|
PORT: E2E_PORT,
|
||||||
};
|
};
|
||||||
if (process.env.REDIS_HOST) {
|
if (process.env.REDIS_HOST) {
|
||||||
serverEnv.REDIS_HOST = process.env.REDIS_HOST;
|
serverEnv.REDIS_HOST = process.env.REDIS_HOST;
|
||||||
@@ -50,7 +54,7 @@ export default defineConfig({
|
|||||||
cwd: path.resolve(__dirname, '../server'),
|
cwd: path.resolve(__dirname, '../server'),
|
||||||
// Poll a dedicated health endpoint — polling '/' can stall in Express 5 when
|
// Poll a dedicated health endpoint — polling '/' can stall in Express 5 when
|
||||||
// server/public/ doesn't exist in the working directory (no finalhandler match).
|
// server/public/ doesn't exist in the working directory (no finalhandler match).
|
||||||
url: `http://127.0.0.1:3001/api/health`,
|
url: `http://127.0.0.1:${E2E_PORT}/api/health`,
|
||||||
timeout: 15_000,
|
timeout: 15_000,
|
||||||
reuseExistingServer: !process.env.CI,
|
reuseExistingServer: !process.env.CI,
|
||||||
env: serverEnv,
|
env: serverEnv,
|
||||||
|
|||||||
+4
-3
@@ -201,9 +201,10 @@ app.use("/api/changelogs", changelogRoutes);
|
|||||||
app.use("/api/groups", groupRoutes);
|
app.use("/api/groups", groupRoutes);
|
||||||
app.use("/api/stores", storeRoutes);
|
app.use("/api/stores", storeRoutes);
|
||||||
|
|
||||||
app.get('*splat', (_req, res) => {
|
app.use(express.static(path.join(process.cwd(), 'public')));
|
||||||
res.sendFile(path.join(process.cwd(), 'public', 'index.html'));
|
app.get('*splat', (_req, res) => {
|
||||||
});
|
res.sendFile(path.join(process.cwd(), 'public', 'index.html'));
|
||||||
|
});
|
||||||
|
|
||||||
// Middleware pro zpracování chyb
|
// Middleware pro zpracování chyb
|
||||||
app.use((err: any, req: any, res: any, next: any) => {
|
app.use((err: any, req: any, res: any, next: any) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user