forked from baron/baron-sso
fix(adminfront): fix playwright webserver timeout by refining preview command and vite config
This commit is contained in:
@@ -85,9 +85,9 @@ export default defineConfig({
|
|||||||
? undefined
|
? undefined
|
||||||
: {
|
: {
|
||||||
command: process.env.CI
|
command: process.env.CI
|
||||||
? `pnpm run preview -- --port ${port}`
|
? `pnpm exec vite preview --host 127.0.0.1 --port ${port} --strictPort`
|
||||||
: `pnpm run dev -- --host localhost --port ${port}`,
|
: `pnpm exec vite --host 127.0.0.1 --port ${port} --strictPort`,
|
||||||
url: `http://localhost:${port}`,
|
url: `http://127.0.0.1:${port}`,
|
||||||
reuseExistingServer,
|
reuseExistingServer,
|
||||||
timeout: 180 * 1000,
|
timeout: 180 * 1000,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -24,4 +24,13 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
preview: {
|
||||||
|
host: "127.0.0.1",
|
||||||
|
proxy: {
|
||||||
|
"/api": {
|
||||||
|
target: process.env.API_PROXY_TARGET || "http://localhost:3000",
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -295,7 +295,7 @@ fi
|
|||||||
echo "==> adminfront using PORT=$port"
|
echo "==> adminfront using PORT=$port"
|
||||||
(
|
(
|
||||||
cd "$tmp_dir/adminfront"
|
cd "$tmp_dir/adminfront"
|
||||||
PORT="$port" PLAYWRIGHT_WORKERS="${PLAYWRIGHT_WORKERS:-1}" \
|
CI=true PORT="$port" PLAYWRIGHT_WORKERS="${PLAYWRIGHT_WORKERS:-1}" \
|
||||||
pnpm exec playwright test "${playwright_project_args[@]}"
|
pnpm exec playwright test "${playwright_project_args[@]}"
|
||||||
) 2>&1 | tee reports/adminfront-test.log
|
) 2>&1 | tee reports/adminfront-test.log
|
||||||
test_exit_code=${PIPESTATUS[0]}
|
test_exit_code=${PIPESTATUS[0]}
|
||||||
|
|||||||
Reference in New Issue
Block a user