Skip to content

Commit 887849d

Browse files
authored
chore(NODE-6018): run entire BSON suite on a big endian machine (#726)
1 parent eba09e7 commit 887849d

File tree

4 files changed

+37
-34
lines changed

4 files changed

+37
-34
lines changed

.evergreen/config.yml

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,6 @@ functions:
5050
args:
5151
- .evergreen/run-tests.sh
5252

53-
run big endian tests:
54-
- command: subprocess.exec
55-
type: test
56-
params:
57-
working_dir: src
58-
add_expansions_to_env: true
59-
binary: bash
60-
args:
61-
- .evergreen/run-big-endian-test.sh
62-
6353
run checks:
6454
- command: subprocess.exec
6555
type: test
@@ -165,6 +155,14 @@ tasks:
165155
NODE_LTS_VERSION: 20
166156
- func: install dependencies
167157
- func: run tests
158+
- name: node-tests-v22
159+
tags: ["node"]
160+
commands:
161+
- func: fetch source
162+
vars:
163+
NODE_LTS_VERSION: 22
164+
- func: install dependencies
165+
- func: run tests
168166
- name: node-tests-latest
169167
tags: ["node"]
170168
commands:
@@ -180,7 +178,7 @@ tasks:
180178
commands:
181179
- func: fetch source
182180
vars:
183-
NODE_LTS_VERSION: 20
181+
NODE_LTS_VERSION: 22
184182
- func: install dependencies
185183
- func: run tests
186184
vars:
@@ -189,15 +187,15 @@ tasks:
189187
commands:
190188
- func: fetch source
191189
vars:
192-
NODE_LTS_VERSION: 20
190+
NODE_LTS_VERSION: 22
193191
- func: install dependencies
194192
- func: run bundling
195193
- name: no-bigint-web-tests
196194
tags: ["no-bigint", "web"]
197195
commands:
198196
- func: fetch source
199197
vars:
200-
NODE_LTS_VERSION: 20
198+
NODE_LTS_VERSION: 22
201199
- func: install dependencies
202200
- func: run tests
203201
vars:
@@ -209,14 +207,14 @@ tasks:
209207
commands:
210208
- func: fetch source
211209
vars:
212-
NODE_LTS_VERSION: 20
210+
NODE_LTS_VERSION: 22
213211
- func: install dependencies
214212
- func: run checks
215213
- name: check-typescript-oldest
216214
commands:
217215
- func: fetch source
218216
vars:
219-
NODE_LTS_VERSION: 20
217+
NODE_LTS_VERSION: 22
220218
- func: install dependencies
221219
- func: "run typescript"
222220
vars:
@@ -226,7 +224,7 @@ tasks:
226224
commands:
227225
- func: fetch source
228226
vars:
229-
NODE_LTS_VERSION: 20
227+
NODE_LTS_VERSION: 22
230228
- func: install dependencies
231229
- func: "run typescript"
232230
vars:
@@ -236,7 +234,7 @@ tasks:
236234
commands:
237235
- func: fetch source
238236
vars:
239-
NODE_LTS_VERSION: 20
237+
NODE_LTS_VERSION: 22
240238
- func: install dependencies
241239
- func: "run typescript"
242240
vars:
@@ -288,28 +286,19 @@ tasks:
288286
commands:
289287
- func: fetch source
290288
vars:
291-
NODE_LTS_VERSION: 20
289+
NODE_LTS_VERSION: 22
292290
- func: install dependencies
293291
- func: run eslint plugin tests
294-
- name: node-tests-big-endian
295-
commands:
296-
- func: fetch source
297-
vars:
298-
NODE_LTS_VERSION: 20
299-
- func: install dependencies
300-
vars:
301-
NPM_OPTIONS: "--ignore-scripts"
302-
- func: run big endian tests
303292

304293
buildvariants:
305294
- name: linux
306295
display_name: RHEL 8.0
307296
run_on: rhel80-small
308297
tasks: [".node", ".web", "check-eslint-plugin"]
309298
- name: linux-zseries
310-
display_name: RHEL 8.3 zSeries
311-
run_on: rhel83-zseries-small
312-
tasks: ["node-tests-big-endian"]
299+
display_name: RHEL 9.0 zSeries
300+
run_on: rhel9-zseries-small
301+
tasks: [".node", ".web"]
313302
- name: lint
314303
display_name: lint
315304
run_on: rhel80-small

test/s390x/big_endian.test.ts renamed to test/node/big_endian.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ FLOAT[0] = -1;
99
// Big endian [191, 240, 0, 0, 0, 0, 0, 0]
1010
const isBigEndian = FLOAT_BYTES[7] === 0;
1111

12-
context(`handles big endianness correctly`, () => {
12+
describe(`handles big endianness correctly`, () => {
1313
before(function () {
1414
if (!isBigEndian) {
15-
throw new Error('expected to only run on big endian system');
15+
this.skip();
1616
}
1717
});
1818

test/node/double.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,9 @@ describe('BSON Double Precision', function () {
339339
expect(type).to.equal(BSON_DATA_NUMBER);
340340
expect(type).to.not.equal(BSON_DATA_INT);
341341
expect(serializedDouble.subarray(7, 15)).to.deep.equal(
342-
new Uint8Array(new Float64Array([-0]).buffer)
342+
// Use this on an LE system to re-create the following bytes:
343+
// new Uint8Array(new Float64Array([-0]).buffer)
344+
new Uint8Array([0, 0, 0, 0, 0, 0, 0, 128])
343345
);
344346
});
345347

test/node/release.test.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ const REQUIRED_FILES = [
6666

6767
describe(`Release ${packFile}`, function () {
6868
let tarFileList;
69+
70+
before(function () {
71+
if (process.arch !== 'x64') {
72+
// This test doesn't need to run more than once on one of our platforms.
73+
this.skip();
74+
}
75+
});
76+
6977
before(function () {
7078
this.timeout(120_000); // npm pack can be slow
7179
expect(fs.existsSync(packFile), `expected ${packFile} to NOT exist`).to.equal(false);
@@ -81,7 +89,11 @@ describe(`Release ${packFile}`, function () {
8189
});
8290

8391
after(() => {
84-
fs.unlinkSync(packFile);
92+
try {
93+
fs.unlinkSync(packFile);
94+
} catch (error) {
95+
if (error.code !== 'ENOENT') throw error;
96+
}
8597
});
8698

8799
for (const requiredFile of REQUIRED_FILES) {

0 commit comments

Comments
 (0)