diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index 7527180b..ea32703a 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -54,12 +54,10 @@ runs: # export DEBUG='electron-forge:*,sidecar' # fi - runner_os="$(echo "${RUNNER_OS}" | tr '[:upper:]' '[:lower:]')" - npm ci npm run lint npm run package - npm run test-${runner_os} + npm run test env: # https://www.electronjs.org/docs/latest/api/environment-variables diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 5f7e25a4..d2f8369e 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -79,7 +79,8 @@ "ts-node": "^10.9.2", "tslib": "2.6.2", "typescript": "^5.3.3", - "url-loader": "4.1.1" + "url-loader": "4.1.1", + "xvfb-maybe": "^0.2.1" }, "engines": { "node": ">=18 <20" @@ -23312,6 +23313,46 @@ "xterm": "^4.0.0" } }, + "node_modules/xvfb-maybe": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/xvfb-maybe/-/xvfb-maybe-0.2.1.tgz", + "integrity": "sha512-9IyRz3l6Qyhl6LvnGRF5jMPB4oBEepQnuzvVAFTynP6ACLLSevqigICJ9d/+ofl29m2daeaVBChnPYUnaeJ7yA==", + "dev": true, + "dependencies": { + "debug": "^2.2.0", + "which": "^1.2.4" + }, + "bin": { + "xvfb-maybe": "src/xvfb-maybe.js" + } + }, + "node_modules/xvfb-maybe/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/xvfb-maybe/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/xvfb-maybe/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, "node_modules/xxhash-addon": { "version": "2.0.1", "hasInstallScript": true, @@ -38705,6 +38746,42 @@ "dev": true, "requires": {} }, + "xvfb-maybe": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/xvfb-maybe/-/xvfb-maybe-0.2.1.tgz", + "integrity": "sha512-9IyRz3l6Qyhl6LvnGRF5jMPB4oBEepQnuzvVAFTynP6ACLLSevqigICJ9d/+ofl29m2daeaVBChnPYUnaeJ7yA==", + "dev": true, + "requires": { + "debug": "^2.2.0", + "which": "^1.2.4" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "xxhash-addon": { "version": "2.0.1" }, diff --git a/package.json b/package.json index 84eeb0f1..ddf7b6e0 100644 --- a/package.json +++ b/package.json @@ -16,12 +16,9 @@ "scripts": { "prettify": "prettier --write lib/**/*.css && balena-lint --fix --typescript typings lib tests forge.config.ts forge.sidecar.ts webpack.config.ts", "lint": "npm run prettify && catch-uncommitted", - "test-gui": "electron-mocha --recursive --reporter spec --window-config tests/gui/window-config.json --require ts-node/register/transpile-only --require-main tests/gui/allow-renderer-process-reuse.ts --full-trace --no-sandbox --renderer tests/gui/**/*.ts", - "test-shared": "electron-mocha --recursive --reporter spec --require ts-node/register/transpile-only --require-main tests/gui/allow-renderer-process-reuse.ts --full-trace --no-sandbox tests/shared/**/*.ts", - "test-windows": "npm run lint && npm run test-gui && npm run test-shared", - "test-macos": "npm run lint && npm run test-gui && npm run test-shared", - "test-linux": "npm run lint && xvfb-run --auto-servernum npm run test-gui && xvfb-run --auto-servernum npm run test-shared", - "test": "echo npm run test-{linux,windows,macos}", + "test-gui": "xvfb-maybe electron-mocha --recursive --reporter spec --window-config tests/gui/window-config.json --require ts-node/register/transpile-only --require-main tests/gui/allow-renderer-process-reuse.ts --full-trace --no-sandbox --renderer tests/gui/**/*.ts", + "test-shared": "xvfb-maybe electron-mocha --recursive --reporter spec --require ts-node/register/transpile-only --require-main tests/gui/allow-renderer-process-reuse.ts --full-trace --no-sandbox tests/shared/**/*.ts", + "test": "npm run test-gui && npm run test-shared", "package": "electron-forge package", "start": "electron-forge start", "make": "electron-forge make" @@ -104,7 +101,8 @@ "ts-node": "^10.9.2", "tslib": "2.6.2", "typescript": "^5.3.3", - "url-loader": "4.1.1" + "url-loader": "4.1.1", + "xvfb-maybe": "^0.2.1" }, "hostDependencies": { "debian": [