Skip to content

Commit

Permalink
Fix broken main test (#950)
Browse files Browse the repository at this point in the history
* migrate to Yarn 3

* fix broken cache test

* update CI node versions

* pin node-preload to 0.2.0

Due to yarnpkg/berry#1841
  • Loading branch information
JLHwung authored Aug 26, 2022
1 parent 0b338e4 commit df28fe3
Show file tree
Hide file tree
Showing 7 changed files with 1,652 additions and 914 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [10.x, 12.x, 14.x, 15.x]
node-version: [12.x, 14.x, 16.x]
webpack-version: [latest, '4']
include:
- node: 14.x
- node-version: 18.x
webpack-version: latest
os: ubuntu-latest
coverage: true
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -55,10 +56,10 @@ jobs:
YARN_NODE_LINKER: node-modules
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
- name: Use Node.js latest
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: '*'
- name: Install dependencies
run: yarn
- name: Install webpack 4
Expand Down
55 changes: 0 additions & 55 deletions .yarn/releases/yarn-2.3.3.cjs

This file was deleted.

783 changes: 783 additions & 0 deletions .yarn/releases/yarn-3.2.3.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
yarnPath: .yarn/releases/yarn-2.3.3.cjs
yarnPath: .yarn/releases/yarn-3.2.3.cjs
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,8 @@
"node ./scripts/yarn-install.js",
"git add yarn.lock"
]
},
"resolutions": {
"nyc/node-preload": "0.2.0"
}
}
10 changes: 7 additions & 3 deletions test/cache.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ const globalConfig = {
},
};

// Cache filename is either SHA256 or MD5 hash
const UNCOMPRESSED_CACHE_FILE_REGEX = /^[0-9a-f]{32}(?:[0-9a-f]{32})?\.json$/;
const CACHE_FILE_REGEX = /^[0-9a-f]{32}(?:[0-9a-f]{32})?\.json\.gz$/;

// Create a separate directory for each test so that the tests
// can run in parallel

Expand Down Expand Up @@ -109,7 +113,7 @@ test.serial.cb(
t.deepEqual(stats.compilation.warnings, []);

fs.readdir(defaultCacheDir, (err, files) => {
files = files.filter(file => /\b[0-9a-f]{5,40}\.json\.gz\b/.test(file));
files = files.filter(file => CACHE_FILE_REGEX.test(file));

t.is(err, null);
t.true(files.length > 0);
Expand Down Expand Up @@ -146,7 +150,7 @@ test.serial.cb(
t.is(err, null);

fs.readdir(defaultCacheDir, (err, files) => {
files = files.filter(file => /\b[0-9a-f]{5,40}\b/.test(file));
files = files.filter(file => UNCOMPRESSED_CACHE_FILE_REGEX.test(file));

t.is(err, null);
t.true(files.length > 0);
Expand Down Expand Up @@ -180,7 +184,7 @@ test.serial.cb(
t.deepEqual(stats.compilation.warnings, []);

fs.readdir(defaultCacheDir, (err, files) => {
files = files.filter(file => /\b[0-9a-f]{5,40}\.json\.gz\b/.test(file));
files = files.filter(file => CACHE_FILE_REGEX.test(file));

t.is(err, null);

Expand Down
Loading

0 comments on commit df28fe3

Please sign in to comment.