Start the smoke test server on the port in SMOKE_URL
Two checkouts can then run their smoke tests at the same time.
This commit is contained in:
+3
-1
@@ -115,7 +115,9 @@ async function reachable(url) {
|
||||
|
||||
async function startServer() {
|
||||
const vite = path.join(root, "node_modules", "vite", "bin", "vite.js");
|
||||
const server = spawn(process.execPath, [vite, "dev"], { cwd: root, stdio: "ignore", windowsHide: true });
|
||||
// Serve on the port in SMOKE_URL, so that two checkouts can run their tests at the same time.
|
||||
const port = new URL(env.SMOKE_URL).port || "1420";
|
||||
const server = spawn(process.execPath, [vite, "dev", "--port", port, "--strictPort"], { cwd: root, stdio: "ignore", windowsHide: true });
|
||||
for (let waited = 0; waited < 60000; waited += 500) {
|
||||
if (await reachable(env.SMOKE_URL)) return server;
|
||||
await new Promise(resolve => setTimeout(resolve, 500));
|
||||
|
||||
Reference in New Issue
Block a user