From 35fbd220710082ff99bce8f4d490796496a6b652 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sun, 4 Jul 2021 23:07:37 +0100 Subject: [PATCH] Build: Update grunt-contrib-qunit to fix caching of Chromium binary * Puppeteer stores the Chromium binary only in node_modules/ (not in $XDG_CACHE_HOME or some other directory that is generally persisted in dev and CI environments, nor in any other directory that one can opt-in to caching/persistence). This was fixed in Puppeteer 5+ (ref https://github.com/puppeteer/puppeteer/pull/6014), through an opt-in PUPPETEER_DOWNLOAD_PATH env var. * I enalbed this in commit 7cd99a28ae72, but it didn't do anything yet as grunt-contrib-qunit wasn't using the newer Puppeteer yet. This was fixed in https://github.com/gruntjs/grunt-contrib-qunit/pull/173. * Fix ENV syntax. - Tildes aren't expanded in this context. - Other variables like $HOME aren't expanded either. - Absolute paths like /tmp can't be used because Windows runners interpret `/tmp` as `D:\tmp`, which doesn't exist by default, and Puppeteer requires the parent dir to exist instead of simply lazy-creating it. - Can't use a relative directory in the workspace like ".puppeteer" because Puppeteer insists on the variable being an absolute path. - We can use the `github.workspace` builtin variable, which we can subsitute per . --- .github/workflows/CI.yaml | 8 ++-- .github/workflows/browsers-full.yaml | 4 +- .github/workflows/browsers-quick.yaml | 4 +- .github/workflows/coverage.yaml | 4 +- package-lock.json | 64 ++++++++++++--------------- package.json | 2 +- 6 files changed, 39 insertions(+), 47 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index c7ca91305..f55ef032d 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -43,7 +43,7 @@ jobs: name: ${{ matrix.name }} runs-on: ${{ matrix.os }} env: - PUPPETEER_DOWNLOAD_PATH: ~/.puppeteer_download + PUPPETEER_DOWNLOAD_PATH: "${{ github.workspace }}/.puppeteer_download" steps: - uses: actions/checkout@v2 @@ -52,7 +52,7 @@ jobs: with: path: | ~/.npm - ~/.puppeteer_download + ${{ github.workspace }}/.puppeteer_download key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} - name: Use Node.js ${{ matrix.node }} @@ -86,14 +86,14 @@ jobs: name: SpiderMonkey runs-on: ubuntu-20.04 env: - PUPPETEER_DOWNLOAD_PATH: ~/.puppeteer_download + PUPPETEER_DOWNLOAD_PATH: "${{ github.workspace }}/.puppeteer_download" steps: - uses: actions/checkout@v2 - uses: actions/cache@v2 with: path: | ~/.npm - ~/.puppeteer_download + ${{ github.workspace }}/.puppeteer_download key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} - name: Use Node.js 10 uses: actions/setup-node@v2 diff --git a/.github/workflows/browsers-full.yaml b/.github/workflows/browsers-full.yaml index 685e2d7ff..cec3eaf41 100644 --- a/.github/workflows/browsers-full.yaml +++ b/.github/workflows/browsers-full.yaml @@ -16,7 +16,7 @@ jobs: if: ${{ github.repository == 'qunitjs/qunit' }} # skip on forks, needs secret runs-on: ubuntu-latest env: - PUPPETEER_DOWNLOAD_PATH: ~/.puppeteer_download + PUPPETEER_DOWNLOAD_PATH: "${{ github.workspace }}/.puppeteer_download" steps: - uses: actions/checkout@v2 @@ -24,7 +24,7 @@ jobs: with: path: | ~/.npm - ~/.puppeteer_download + ${{ github.workspace }}/.puppeteer_download key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} - name: Use Node.js 10 diff --git a/.github/workflows/browsers-quick.yaml b/.github/workflows/browsers-quick.yaml index e38bec0cf..b5d97737d 100644 --- a/.github/workflows/browsers-quick.yaml +++ b/.github/workflows/browsers-quick.yaml @@ -8,7 +8,7 @@ jobs: if: ${{ github.repository == 'qunitjs/qunit' }} # skip on forks, needs secret runs-on: ubuntu-latest env: - PUPPETEER_DOWNLOAD_PATH: ~/.puppeteer_download + PUPPETEER_DOWNLOAD_PATH: "${{ github.workspace }}/.puppeteer_download" steps: - uses: actions/checkout@v2 @@ -16,7 +16,7 @@ jobs: with: path: | ~/.npm - ~/.puppeteer_download + ${{ github.workspace }}/.puppeteer_download key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} - name: Use Node.js 10 diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index b1baad28b..a363d25d2 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -8,7 +8,7 @@ jobs: if: ${{ github.repository == 'qunitjs/qunit' }} # skip on forks, needs secret runs-on: ubuntu-20.04 env: - PUPPETEER_DOWNLOAD_PATH: ~/.puppeteer_download + PUPPETEER_DOWNLOAD_PATH: "${{ github.workspace }}/.puppeteer_download" steps: - uses: actions/checkout@v2 @@ -16,7 +16,7 @@ jobs: with: path: | ~/.npm - ~/.puppeteer_download + ${{ github.workspace }}/.puppeteer_download key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} - name: Use Node.js 14 diff --git a/package-lock.json b/package-lock.json index f9cbb106f..b98db45d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1584,9 +1584,9 @@ } }, "@types/yauzl": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.9.1.tgz", - "integrity": "sha512-A1b8SU4D10uoPjwb0lnHmmu8wZhR9d+9o2PKBQT2jU5YPTKsxac6M2qGAdY7VcL+dHHhARVUDmeg0rOrcd9EjA==", + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.9.2.tgz", + "integrity": "sha512-8uALY5LTvSuHgloDVUvWP3pIauILm+8/0pDMokuDYIoNsOkSwd5AiHBTSEJjKTDcZr5z8UpgOWZkxBF4iJftoA==", "dev": true, "optional": true, "requires": { @@ -2265,6 +2265,12 @@ "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", "dev": true }, + "devtools-protocol": { + "version": "0.0.818844", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.818844.tgz", + "integrity": "sha512-AD1hi7iVJ8OD0aMLQU5VK0XH9LDlA1+BcPIgrAxPfaibx2DbWucuyOhc4oyQCbnvDDO68nN6/LcKfqTP343Jjg==", + "dev": true + }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -3422,14 +3428,14 @@ } }, "grunt-contrib-qunit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-qunit/-/grunt-contrib-qunit-4.0.0.tgz", - "integrity": "sha512-XP9Ks+uoSQzic0eic6koD8kYAKQnSYfu2G1HBqvrvUyXaDDnSSXOKELND8j7dwudnJj4N6KgW6OU7AHeM5PGKA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/grunt-contrib-qunit/-/grunt-contrib-qunit-5.0.1.tgz", + "integrity": "sha512-AMu1sILcoFHqgsXaUpZBnKMVQ8rSTv6zHxLEz2maoLd5DqPV42KtzsPItf5e0c2iRtZ9J5ZG0kTQ9I/q5LQAYQ==", "dev": true, "requires": { "eventemitter2": "^6.4.2", "p-each-series": "^2.1.0", - "puppeteer": "^4.0.0" + "puppeteer": "^5.0.0" }, "dependencies": { "eventemitter2": { @@ -4421,12 +4427,6 @@ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, - "mitt": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mitt/-/mitt-2.1.0.tgz", - "integrity": "sha512-ILj2TpLiysu2wkBbWjAmww7TkZb65aiQO+DkVdUTBpBXq+MHYiETENkKFMtsJZX1Lf4pe4QOrTSjIfUwN5lRdg==", - "dev": true - }, "mkdirp": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", @@ -4493,6 +4493,12 @@ "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", "dev": true }, + "node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "dev": true + }, "node-http2": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/node-http2/-/node-http2-4.0.1.tgz", @@ -4984,16 +4990,17 @@ "dev": true }, "puppeteer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-4.0.1.tgz", - "integrity": "sha512-LIiSWTRqpTnnm3R2yAoMBx1inSeKwVZy66RFSkgSTDINzheJZPd5z5mMbPM0FkvwWAZ27a+69j5nZf+Fpyhn3Q==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-5.5.0.tgz", + "integrity": "sha512-OM8ZvTXAhfgFA7wBIIGlPQzvyEETzDjeRa4mZRCRHxYL+GNH5WAuYUQdja3rpWZvkX/JKqmuVgbsxDNsDFjMEg==", "dev": true, "requires": { "debug": "^4.1.0", + "devtools-protocol": "0.0.818844", "extract-zip": "^2.0.0", "https-proxy-agent": "^4.0.0", - "mime": "^2.0.3", - "mitt": "^2.0.1", + "node-fetch": "^2.6.1", + "pkg-dir": "^4.2.0", "progress": "^2.0.1", "proxy-from-env": "^1.0.0", "rimraf": "^3.0.2", @@ -5002,25 +5009,10 @@ "ws": "^7.2.3" }, "dependencies": { - "mime": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz", - "integrity": "sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, "ws": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.4.tgz", - "integrity": "sha512-Qm8k8ojNQIMx7S+Zp8u/uHOx7Qazv3Yv4q68MiWWWOJhiwG5W3x7iqmRtJo8xxrciZUY4vRxUTJCKuRnF28ZZw==", + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.2.tgz", + "integrity": "sha512-lkF7AWRicoB9mAgjeKbGqVUekLnSNO4VjKVnuPHpQeOxZOErX6BPXwJk70nFslRCEEA8EVW7ZjKwXaP9N+1sKQ==", "dev": true } } diff --git a/package.json b/package.json index ecd1949ed..907a719d4 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "grunt": "^1.4.1", "grunt-contrib-connect": "^3.0.0", "grunt-contrib-copy": "^1.0.0", - "grunt-contrib-qunit": "^4.0.0", + "grunt-contrib-qunit": "^5.0.1", "grunt-git-authors": "^3.2.0", "grunt-search": "^0.1.8", "kleur": "4.1.4",