Skip to content

Commit f14cf05

Browse files
authored
chore(ci): run all checks always (#523)
* chore(ci): run all checks always * remove another --since * remove redundant npm ci; reformat all files * format .esm-wrapper.mjs * fix test fixtures * try to fix windows tests * Disable proxy test on linux; use cross-spawn on Windows * fix lint * fix timing issue with date tests * Disable 6.x test on linux * Rework date test * revert to always creating a new date * remove unnecessary assertions
1 parent a70640d commit f14cf05

File tree

20 files changed

+268
-442
lines changed

20 files changed

+268
-442
lines changed

.github/workflows/check-test.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,8 @@ jobs:
7878
# Dependencies are included when installing as npm workspaces will
7979
# hoist every package in the repo and it's important that the
8080
# dependencies of packages we are planning to test are also prepared
81-
npm ci
8281
npm run bootstrap-ci -- --scope @mongodb-js/monorepo-tools --stream --include-dependencies
83-
npm run bootstrap-ci -- --stream --since ${SINCE_REF} --include-dependencies
82+
npm run bootstrap-ci -- --stream --include-dependencies
8483
8584
# saslprep source code may have been modified by bootstrapping,
8685
# depending on the OS, so undo that change if it has happened
@@ -99,9 +98,9 @@ jobs:
9998
# We exclude dependents when running eslint and depchecks because
10099
# linting and dependency checking is relevant only for packages where
101100
# the source code was changed
102-
run: npm run check-ci -- --stream --since ${SINCE_REF} --exclude-dependents
101+
run: npm run check-ci -- --stream
103102
shell: bash
104103

105104
- name: Run Tests
106-
run: npm run test-ci -- --stream --since ${SINCE_REF}
105+
run: npm run test-ci -- --stream
107106
shell: bash

package-lock.json

Lines changed: 30 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/devtools-proxy-support/src/fetch.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ import { HTTPServerProxyTestSetup } from '../test/helpers';
44

55
describe('createFetch', function () {
66
it("consistency check: plain `import('node-fetch')` fails", async function () {
7+
if (process.versions.node >= '20.19.0') {
8+
// 'node 20.19.0 has require(esm) enabled by default'
9+
return this.skip();
10+
}
11+
712
let failed = false;
813
try {
914
await import('node-fetch');

packages/devtools-proxy-support/src/proxy-options.spec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,12 @@ describe('proxy options handling', function () {
172172
let setup: HTTPServerProxyTestSetup;
173173

174174
before(async function () {
175-
if (process.platform === 'win32' && process.env.CI) {
175+
// TODO: COMPASS-9232 reenable the test on Linux and, ideally, on Windows, after
176+
// investigating the failures.
177+
if (
178+
(process.platform === 'win32' || process.platform === 'linux') &&
179+
process.env.CI
180+
) {
176181
return this.skip();
177182
}
178183
setup = new HTTPServerProxyTestSetup();

packages/download-url/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"bootstrap": "npm run compile",
77
"prepublishOnly": "npm run compile",
8-
"compile": "tsc -p tsconfig.json && gen-esm-wrapper . ./.esm-wrapper.mjs",
8+
"compile": "tsc -p tsconfig.json && gen-esm-wrapper . ./.esm-wrapper.mjs && prettier --write .esm-wrapper.mjs",
99
"typecheck": "tsc --noEmit",
1010
"eslint": "eslint",
1111
"prettier": "prettier",

packages/mongodb-runner/src/mongocluster.spec.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,15 @@ describe('MongoCluster', function () {
212212
});
213213

214214
it('can spawn a 6.x enterprise standalone mongod', async function () {
215-
if (process.platform === 'win32' && process.env.CI) {
216-
return this.skip(); // Github Actions CI runners go OOM when extracting the 6.x enterprise tarball...
215+
if (
216+
(process.platform === 'win32' || process.platform === 'linux') &&
217+
process.env.CI
218+
) {
219+
// Github Actions CI runners go OOM on Windows when extracting the 6.x enterprise tarball...
220+
// On Ubuntu, 6.x only supports up to 22.04, while CI runs on 24.04.
221+
return this.skip();
217222
}
223+
218224
cluster = await MongoCluster.start({
219225
version: '6.x-enterprise',
220226
topology: 'standalone',
@@ -229,6 +235,21 @@ describe('MongoCluster', function () {
229235
expect(ok).to.equal(1);
230236
});
231237

238+
it('can spawn a 8.x enterprise standalone mongod', async function () {
239+
cluster = await MongoCluster.start({
240+
version: '8.x-enterprise',
241+
topology: 'standalone',
242+
tmpDir,
243+
});
244+
expect(cluster.connectionString).to.be.a('string');
245+
expect(cluster.serverVersion).to.match(/^8\./);
246+
expect(cluster.serverVariant).to.equal('enterprise');
247+
const { ok } = await cluster.withClient(async (client) => {
248+
return await client.db('admin').command({ ping: 1 });
249+
});
250+
expect(ok).to.equal(1);
251+
});
252+
232253
it('can serialize and deserialize sharded cluster info', async function () {
233254
cluster = await MongoCluster.start({
234255
version: '6.x',

packages/monorepo-tools/src/utils/fixtures/bump-package-1-breaking.json

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"lock": {
4343
"name": "test-repo",
4444
"version": "1.0.0",
45-
"lockfileVersion": 2,
45+
"lockfileVersion": 3,
4646
"requires": true,
4747
"packages": {
4848
"": {
@@ -107,41 +107,6 @@
107107
"package5": "2.0.0"
108108
}
109109
}
110-
},
111-
"dependencies": {
112-
"package1": {
113-
"version": "file:packages/package1"
114-
},
115-
"package2": {
116-
"version": "file:packages/package2",
117-
"requires": {
118-
"package1": "2.0.0"
119-
}
120-
},
121-
"package3": {
122-
"version": "file:packages/package3",
123-
"requires": {
124-
"package1": "2.0.0"
125-
}
126-
},
127-
"package4": {
128-
"version": "file:packages/package4",
129-
"requires": {
130-
"package3": "1.0.1"
131-
}
132-
},
133-
"package5": {
134-
"version": "file:packages/package5",
135-
"requires": {
136-
"package1": "2.0.0"
137-
}
138-
},
139-
"package6": {
140-
"version": "file:packages/package6",
141-
"requires": {
142-
"package5": "2.0.0"
143-
}
144-
}
145110
}
146111
}
147112
}

packages/monorepo-tools/src/utils/fixtures/bump-package-1-feat.json

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"lock": {
4343
"name": "test-repo",
4444
"version": "1.0.0",
45-
"lockfileVersion": 2,
45+
"lockfileVersion": 3,
4646
"requires": true,
4747
"packages": {
4848
"": {
@@ -107,41 +107,6 @@
107107
"package5": "1.1.0"
108108
}
109109
}
110-
},
111-
"dependencies": {
112-
"package1": {
113-
"version": "file:packages/package1"
114-
},
115-
"package2": {
116-
"version": "file:packages/package2",
117-
"requires": {
118-
"package1": "1.1.0"
119-
}
120-
},
121-
"package3": {
122-
"version": "file:packages/package3",
123-
"requires": {
124-
"package1": "1.1.0"
125-
}
126-
},
127-
"package4": {
128-
"version": "file:packages/package4",
129-
"requires": {
130-
"package3": "1.0.1"
131-
}
132-
},
133-
"package5": {
134-
"version": "file:packages/package5",
135-
"requires": {
136-
"package1": "1.1.0"
137-
}
138-
},
139-
"package6": {
140-
"version": "file:packages/package6",
141-
"requires": {
142-
"package5": "1.1.0"
143-
}
144-
}
145110
}
146111
}
147112
}

packages/monorepo-tools/src/utils/fixtures/bump-package-without-deps.json

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"lock": {
4343
"name": "test-repo",
4444
"version": "1.0.0",
45-
"lockfileVersion": 2,
45+
"lockfileVersion": 3,
4646
"requires": true,
4747
"packages": {
4848
"": {
@@ -107,41 +107,6 @@
107107
"package5": "1.0.0"
108108
}
109109
}
110-
},
111-
"dependencies": {
112-
"package1": {
113-
"version": "file:packages/package1"
114-
},
115-
"package2": {
116-
"version": "file:packages/package2",
117-
"requires": {
118-
"package1": "1.0.0"
119-
}
120-
},
121-
"package3": {
122-
"version": "file:packages/package3",
123-
"requires": {
124-
"package1": "1.0.0"
125-
}
126-
},
127-
"package4": {
128-
"version": "file:packages/package4",
129-
"requires": {
130-
"package3": "1.0.0"
131-
}
132-
},
133-
"package5": {
134-
"version": "file:packages/package5",
135-
"requires": {
136-
"package1": "1.0.0"
137-
}
138-
},
139-
"package6": {
140-
"version": "file:packages/package6",
141-
"requires": {
142-
"package5": "1.0.0"
143-
}
144-
}
145110
}
146111
}
147112
}

packages/monorepo-tools/src/utils/fixtures/last-commit-is-bump.json

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"lock": {
4343
"name": "test-repo",
4444
"version": "1.0.0",
45-
"lockfileVersion": 2,
45+
"lockfileVersion": 3,
4646
"requires": true,
4747
"packages": {
4848
"": {
@@ -107,41 +107,6 @@
107107
"package5": "1.0.0"
108108
}
109109
}
110-
},
111-
"dependencies": {
112-
"package1": {
113-
"version": "file:packages/package1"
114-
},
115-
"package2": {
116-
"version": "file:packages/package2",
117-
"requires": {
118-
"package1": "1.0.0"
119-
}
120-
},
121-
"package3": {
122-
"version": "file:packages/package3",
123-
"requires": {
124-
"package1": "1.0.0"
125-
}
126-
},
127-
"package4": {
128-
"version": "file:packages/package4",
129-
"requires": {
130-
"package3": "1.0.0"
131-
}
132-
},
133-
"package5": {
134-
"version": "file:packages/package5",
135-
"requires": {
136-
"package1": "1.0.0"
137-
}
138-
},
139-
"package6": {
140-
"version": "file:packages/package6",
141-
"requires": {
142-
"package5": "1.0.0"
143-
}
144-
}
145110
}
146111
}
147112
}

0 commit comments

Comments
 (0)