Skip to content

Commit

Permalink
chore: remove canvas test (#388)
Browse files Browse the repository at this point in the history
This fixes an issue when a contributor runs `npm install` using Apple
Silicon which would fail since there is no precompiled arm64 binary to
download for `canvas`. The error looks like this:

```
npm ERR! node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v108-darwin-unknown-arm64.tar.gz
npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v108-darwin-unknown-arm64.tar.gz 
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for canvas@2.11.2 and node@18.19.0 (node-v108 ABI, unknown) (falling back to source compile with node-gyp) 
```

Since we don't have a [special
case](https://github.com/vercel/nft/blob/main/src/utils/special-cases.ts)
for `canvas` and it never worked with Vercel deployments, we can remove
the test.

It also doesn't decrease code coverage (in fact, I bumped code coverage
thresholds just to be sure).

### Related
- Automattic/node-canvas#1733
- vercel/vercel#3460
  • Loading branch information
styfle authored Feb 2, 2024
1 parent d7fc336 commit 67d76d2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-14, windows-latest]
node: [18, 20]
runs-on: ${{ matrix.os }}
services:
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Run Tests
env:
BULL_REDIS_CONNECTION: ${{ (matrix.os == 'ubuntu-latest') && 'redis://127.0.0.1:6379/0' || '' }}
run: npm run test-verbose
run: npm run ${{ (matrix.os == 'ubuntu-latest') && 'test-verbose' || 'test' }}
- name: Maybe Release
if: matrix.os == 'ubuntu-latest' && matrix.node == 18 && github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
Expand Down
6 changes: 3 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module.exports = {
coverageReporters: ["html", "lcov"],
coverageThreshold: {
global: {
branches: 80.5,
functions: 95.2,
lines: 85.87,
branches: 87.29,
functions: 96.25,
lines: 92.33,
statements: -249
}
},
Expand Down
21 changes: 14 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
"bull": "^3.10.0",
"bullmq": "^4.10.0",
"camaro": "^6.1.0",
"canvas": "^2.11.2",
"chromeless": "^1.5.2",
"consolidate": "^0.15.1",
"copy": "^0.3.2",
Expand Down
6 changes: 0 additions & 6 deletions test/integration/canvas.js

This file was deleted.

0 comments on commit 67d76d2

Please sign in to comment.