From 2df2f63e861896d131e422e9687a46fbfbc71275 Mon Sep 17 00:00:00 2001 From: Allan Oricil Date: Sun, 3 Nov 2024 20:36:22 -0300 Subject: [PATCH] chore(tests-e2e): attempt to start dev server in the background --- .github/workflows/playwright.yml | 2 +- node-red-server.js | 21 --------------------- 2 files changed, 1 insertion(+), 22 deletions(-) delete mode 100644 node-red-server.js diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 32cdd5a..48317f8 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -23,7 +23,7 @@ jobs: run: npx playwright install --with-deps - name: Start Dev - run: npm run start:test + run: npm run start:test & - name: Run Playwright tests run: npx playwright test diff --git a/node-red-server.js b/node-red-server.js deleted file mode 100644 index 02f8180..0000000 --- a/node-red-server.js +++ /dev/null @@ -1,21 +0,0 @@ -const { spawn } = require("child_process"); -const path = require("path"); - -// Path to red.js in the Node-RED module -const redPath = path.join(__dirname, "node_modules", "node-red", "red.js"); -const settingsPath = path.join(__dirname, "node-red/settings.js"); - -// Start Node-RED as a subprocess -const nodeRedProcess = spawn("node", [redPath, "-s", settingsPath], { - stdio: "inherit", // This will pipe the Node-RED output to the main process console - env: process.env, // Inherit the environment variables from the parent process -}); - -// Optional: handle process exit events for cleanup -nodeRedProcess.on("close", (code) => { - console.log(`Node-RED process exited with code ${code}`); -}); - -nodeRedProcess.on("error", (err) => { - console.error("Failed to start Node-RED:", err); -});