From c4bbc10284427ebe439f85e5baedae46fcaea87f Mon Sep 17 00:00:00 2001 From: leejooy96 Date: Wed, 15 Nov 2023 09:04:34 +0900 Subject: [PATCH] test: use native xvfb instead of node package --- .github/workflows/app-test.yml | 16 +++++++++++-- package-lock.json | 43 +--------------------------------- package.json | 6 ++--- 3 files changed, 18 insertions(+), 47 deletions(-) diff --git a/.github/workflows/app-test.yml b/.github/workflows/app-test.yml index 9a99995..1068bf4 100644 --- a/.github/workflows/app-test.yml +++ b/.github/workflows/app-test.yml @@ -29,6 +29,11 @@ jobs: with: fetch-depth: 0 + - name: Install xvfb + if: runner.os == 'ubuntu-latest' + run: | + apt install -y -q --no-install-recommends xvfb + - name: Setup NodeJS ${{ matrix.node_version }} uses: actions/setup-node@v3 with: @@ -50,5 +55,12 @@ jobs: if: steps.npm-cache.outputs.cache-hit != 'true' run: npm i - - name: Test module script - run: npm run test + - name: Test module script (Windows or macOS) + if: runner.os != 'ubuntu-latest' + run: | + npm run test + + - name: Test module script (Linux) + if: runner.os == 'ubuntu-latest' + run: | + npm run test:linux diff --git a/package-lock.json b/package-lock.json index dd79ae1..9509d71 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,8 +44,7 @@ "vite-plugin-eslint": "^1.8.1", "vite-plugin-vuetify": "^1.0.2", "vue-eslint-parser": "^9.3.2", - "vue-tsc": "^1.8.22", - "xvfb-maybe": "^0.2.1" + "vue-tsc": "^1.8.22" }, "engines": { "node": ">=18.0.0" @@ -8668,46 +8667,6 @@ "node": ">=8.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/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index 37165ee..8a7f760 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,8 @@ "lint:fix": "eslint --ext .js,.ts,.vue -f ./node_modules/eslint-friendly-formatter --fix src", "format": "prettier .", "format:fix": "prettier . --write", - "test": "npm run build:pre && xvfb-maybe -- playwright test" + "test": "npm run build:pre && playwright test", + "test:linux": "npm run build:pre && xvfb-run --auto-servernum --server-args='-screen 0, 1280x960x24' -- playwright test" }, "engines": { "node": ">=18.0.0" @@ -70,7 +71,6 @@ "vite-plugin-eslint": "^1.8.1", "vite-plugin-vuetify": "^1.0.2", "vue-eslint-parser": "^9.3.2", - "vue-tsc": "^1.8.22", - "xvfb-maybe": "^0.2.1" + "vue-tsc": "^1.8.22" } }