From 2c0055d732c816f80c70667be56e3326e7c0a1af Mon Sep 17 00:00:00 2001 From: uzlopak Date: Tue, 13 Aug 2024 06:40:33 +0200 Subject: [PATCH 1/2] test: streamline tests in regard of without-intl --- .github/workflows/nodejs.yml | 2 +- package.json | 11 +++++------ scripts/strip-comments.js | 4 +++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index dc5a6a16a63..dc3fbb33304 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -139,7 +139,7 @@ jobs: echo icu config: $(node -e "console.log(process.config)" | grep icu) - name: Run tests - run: npm run test:javascript:withoutintl + run: npm run test:javascript test-fuzzing: name: Fuzzing diff --git a/package.json b/package.json index 1dd93607bb1..7dd4ae8b9c8 100644 --- a/package.json +++ b/package.json @@ -65,19 +65,18 @@ "build:node": "npx esbuild@0.19.10 index-fetch.js --bundle --platform=node --outfile=undici-fetch.js --define:esbuildDetection=1 --keep-names && node scripts/strip-comments.js", "prebuild:wasm": "node build/wasm.js --prebuild", "build:wasm": "node build/wasm.js --docker", + "generate-pem": "node scripts/generate-pem.js", "lint": "standard | snazzy", "lint:fix": "standard --fix | snazzy", "test": "npm run test:javascript && cross-env NODE_V8_COVERAGE= npm run test:typescript", - "test:javascript": "node scripts/generate-pem && npm run test:unit && npm run test:node-fetch && npm run test:cache && npm run test:interceptors && npm run test:fetch && npm run test:cookies && npm run test:eventsource && npm run test:wpt && npm run test:websocket && npm run test:node-test && npm run test:jest", - "test:javascript:withoutintl": "node scripts/generate-pem && npm run test:unit && npm run test:node-fetch && npm run test:fetch:nobuild && npm run test:cache && npm run test:interceptors && npm run test:cookies && npm run test:eventsource:nobuild && npm run test:wpt:withoutintl && npm run test:node-test", + "test:javascript": "npm run test:javascript:no-jest && npm run test:jest", + "test:javascript:no-jest": "npm run generate-pem && npm run test:unit && npm run test:node-fetch && npm run test:cache && npm run test:interceptors && npm run test:fetch && npm run test:cookies && npm run test:eventsource && npm run test:wpt && npm run test:websocket && npm run test:node-test", "test:busboy": "borp -p \"test/busboy/*.js\"", "test:cache": "borp -p \"test/cache/*.js\"", "test:cookies": "borp -p \"test/cookie/*.js\"", - "test:eventsource": "npm run build:node && npm run test:eventsource:nobuild", - "test:eventsource:nobuild": "borp --expose-gc -p \"test/eventsource/*.js\"", + "test:eventsource": "npm run build:node && borp --expose-gc -p \"test/eventsource/*.js\"", "test:fuzzing": "node test/fuzzing/fuzzing.test.js", - "test:fetch": "npm run build:node && npm run test:fetch:nobuild", - "test:fetch:nobuild": "borp --timeout 180000 --expose-gc --concurrency 1 -p \"test/fetch/*.js\" && npm run test:webidl && npm run test:busboy", + "test:fetch": "npm run build:node && borp --timeout 180000 --expose-gc --concurrency 1 -p \"test/fetch/*.js\" && npm run test:webidl && npm run test:busboy", "test:interceptors": "borp -p \"test/interceptors/*.js\"", "test:jest": "cross-env NODE_V8_COVERAGE= jest", "test:unit": "borp --expose-gc -p \"test/*.js\"", diff --git a/scripts/strip-comments.js b/scripts/strip-comments.js index 9e4396a5dea..d687a268090 100644 --- a/scripts/strip-comments.js +++ b/scripts/strip-comments.js @@ -3,6 +3,8 @@ const { readFileSync, writeFileSync } = require('node:fs') const { transcode } = require('node:buffer') -const buffer = transcode(readFileSync('./undici-fetch.js'), 'utf8', 'latin1') +const buffer = transcode + ? transcode(readFileSync('./undici-fetch.js'), 'utf8', 'latin1') + : readFileSync('./undici-fetch.js') writeFileSync('./undici-fetch.js', buffer.toString('latin1')) From b9460ee5505df8fde1af1366dad328a04be38c32 Mon Sep 17 00:00:00 2001 From: uzlopak Date: Tue, 13 Aug 2024 10:21:25 +0200 Subject: [PATCH 2/2] fix wf --- .github/workflows/nodejs.yml | 2 +- package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index dc3fbb33304..f85eca3918a 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -139,7 +139,7 @@ jobs: echo icu config: $(node -e "console.log(process.config)" | grep icu) - name: Run tests - run: npm run test:javascript + run: npm run test:javascript:without-intl test-fuzzing: name: Fuzzing diff --git a/package.json b/package.json index 7dd4ae8b9c8..81d11ea4afd 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,7 @@ "test": "npm run test:javascript && cross-env NODE_V8_COVERAGE= npm run test:typescript", "test:javascript": "npm run test:javascript:no-jest && npm run test:jest", "test:javascript:no-jest": "npm run generate-pem && npm run test:unit && npm run test:node-fetch && npm run test:cache && npm run test:interceptors && npm run test:fetch && npm run test:cookies && npm run test:eventsource && npm run test:wpt && npm run test:websocket && npm run test:node-test", + "test:javascript:without-intl": "npm run test:javascript:no-jest", "test:busboy": "borp -p \"test/busboy/*.js\"", "test:cache": "borp -p \"test/cache/*.js\"", "test:cookies": "borp -p \"test/cookie/*.js\"",