ci: use polling for Playwright Vite server
This commit is contained in:
@@ -19,6 +19,16 @@ const stderrLogFile = path.resolve(serverLogDir, `dev-server-${runtimeNamespace}
|
|||||||
const viteCliPath = path.resolve(process.cwd(), "node_modules/vite/bin/vite.js");
|
const viteCliPath = path.resolve(process.cwd(), "node_modules/vite/bin/vite.js");
|
||||||
const serverOutputLimit = 80;
|
const serverOutputLimit = 80;
|
||||||
const activeOutputReaders = [];
|
const activeOutputReaders = [];
|
||||||
|
const viteServerEnv = {
|
||||||
|
...process.env,
|
||||||
|
PLAYWRIGHT: "1",
|
||||||
|
...(process.env.CI
|
||||||
|
? {
|
||||||
|
CHOKIDAR_INTERVAL: process.env.CHOKIDAR_INTERVAL || "300",
|
||||||
|
CHOKIDAR_USEPOLLING: process.env.CHOKIDAR_USEPOLLING || "true",
|
||||||
|
}
|
||||||
|
: {}),
|
||||||
|
};
|
||||||
// Hardlinked Windows worktrees can break Vite's bundled config temp paths during Playwright boot.
|
// Hardlinked Windows worktrees can break Vite's bundled config temp paths during Playwright boot.
|
||||||
const viteDevArgs = [
|
const viteDevArgs = [
|
||||||
...(process.env.PLAYWRIGHT_VITE_FORCE === "1" ? ["--force"] : []),
|
...(process.env.PLAYWRIGHT_VITE_FORCE === "1" ? ["--force"] : []),
|
||||||
@@ -449,10 +459,7 @@ export default async function globalSetup() {
|
|||||||
const serverProcess = spawn(process.execPath, [viteCliPath, ...viteDevArgs], {
|
const serverProcess = spawn(process.execPath, [viteCliPath, ...viteDevArgs], {
|
||||||
cwd: process.cwd(),
|
cwd: process.cwd(),
|
||||||
detached: true,
|
detached: true,
|
||||||
env: {
|
env: viteServerEnv,
|
||||||
...process.env,
|
|
||||||
PLAYWRIGHT: "1",
|
|
||||||
},
|
|
||||||
stdio: ["ignore", "pipe", "pipe"],
|
stdio: ["ignore", "pipe", "pipe"],
|
||||||
windowsHide: true,
|
windowsHide: true,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user