Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
run: npm run lint

test:
name: Test with Node.js ${{ matrix.node-version }} on ${{ matrix.runs-on }}
name: Test ${{ matrix.node-version == '24' && matrix.runs-on == 'ubuntu-latest' && 'and Coverage ' || ''}}with Node.js ${{ matrix.node-version }} on ${{ matrix.runs-on }}
strategy:
fail-fast: false
max-parallel: 0
Expand Down
76 changes: 37 additions & 39 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ permissions:

jobs:
test:
name: Test with Node.js ${{ inputs.node-version }} on ${{ inputs.runs-on }}
name: Test ${{ inputs.codecov == true && 'and Coverage ' || '' }}with Node.js ${{ inputs.node-version }} on ${{ inputs.runs-on }}
timeout-minutes: 20
runs-on: ${{ inputs.runs-on }}
steps:
Expand Down Expand Up @@ -78,6 +78,22 @@ jobs:
NODE_V8_COVERAGE: ${{ inputs.codecov == true && './coverage/tmp' || '' }}
UNDICI_NO_WASM_SIMD: ${{ inputs['no-wasm-simd'] }}

- name: Test node-test
run: npm run test:node-test
id: test-node-test
env:
CI: true
NODE_V8_COVERAGE: ${{ inputs.codecov == true && './coverage/tmp' || '' }}
UNDICI_NO_WASM_SIMD: ${{ inputs['no-wasm-simd'] }}

- name: Test fetch
run: npm run test:fetch
id: test-fetch
env:
CI: true
NODE_V8_COVERAGE: ${{ inputs.codecov == true && './coverage/tmp' || '' }}
UNDICI_NO_WASM_SIMD: ${{ inputs['no-wasm-simd'] }}

- name: Test node-fetch
run: npm run test:node-fetch
id: test-node-fetch
Expand All @@ -94,33 +110,34 @@ jobs:
NODE_V8_COVERAGE: ${{ inputs.codecov == true && './coverage/tmp' || '' }}
UNDICI_NO_WASM_SIMD: ${{ inputs['no-wasm-simd'] }}

- name: Test cache-interceptor
- name: Test cache-interceptor ${{ inputs.node-version != '20' && 'with' || 'without' }} sqlite
run: npm run test:cache-interceptor
id: test-cache-interceptor
env:
CI: true
NODE_OPTIONS: ${{ inputs.node-version != '20' && '--experimental-sqlite' || '' }}
NODE_V8_COVERAGE: ${{ inputs.codecov == true && './coverage/tmp' || '' }}
UNDICI_NO_WASM_SIMD: ${{ inputs['no-wasm-simd'] }}
- name: Test interceptors
run: npm run test:interceptors
id: test-interceptors

- name: Test cache-tests
run: npm run test:cache-tests
id: test-cache-tests
env:
CI: true
NODE_V8_COVERAGE: ${{ inputs.codecov == true && './coverage/tmp' || '' }}
UNDICI_NO_WASM_SIMD: ${{ inputs['no-wasm-simd'] }}

- name: Test fetch
run: npm run test:fetch
id: test-fetch
- name: Test cookies
run: npm run test:cookies
id: test-cookies
env:
CI: true
NODE_V8_COVERAGE: ${{ inputs.codecov == true && './coverage/tmp' || '' }}
UNDICI_NO_WASM_SIMD: ${{ inputs['no-wasm-simd'] }}
- name: Test cookies
run: npm run test:cookies
id: test-cookies

- name: Test interceptors
run: npm run test:interceptors
id: test-interceptors
env:
CI: true
NODE_V8_COVERAGE: ${{ inputs.codecov == true && './coverage/tmp' || '' }}
Expand All @@ -140,6 +157,7 @@ jobs:
env:
CI: true
NODE_V8_COVERAGE: ${{ inputs.codecov == true && './coverage/tmp' || '' }}
UNDICI_NO_WASM_SIMD: ${{ inputs['no-wasm-simd'] }}

- name: Test subresource-integrity
run: npm run test:subresource-integrity
Expand All @@ -157,38 +175,13 @@ jobs:
NODE_V8_COVERAGE: ${{ inputs.codecov == true && './coverage/tmp' || '' }}
UNDICI_NO_WASM_SIMD: ${{ inputs['no-wasm-simd'] }}

- name: Test node-test
run: npm run test:node-test
id: test-node-test
env:
CI: true
NODE_V8_COVERAGE: ${{ inputs.codecov == true && './coverage/tmp' || '' }}
UNDICI_NO_WASM_SIMD: ${{ inputs['no-wasm-simd'] }}

- name: Test cache-tests
run: npm run test:cache-tests
id: test-cache-tests
env:
CI: true
NODE_V8_COVERAGE: ${{ inputs.codecov == true && './coverage/tmp' || '' }}
UNDICI_NO_WASM_SIMD: ${{ inputs['no-wasm-simd'] }}

- name: Test jest
run: npm run test:jest
id: test-jest
env:
CI: true
NODE_V8_COVERAGE: ''
UNDICI_NO_WASM_SIMD: ${{ inputs['no-wasm-simd'] }}

- name: Test sqlite
if: inputs.node-version != '20'
run: npm run test:sqlite
id: test-sqlite
env:
CI: true
NODE_V8_COVERAGE: ${{ inputs.codecov == true && './coverage/tmp' || '' }}
UNDICI_NO_WASM_SIMD: ${{ inputs['no-wasm-simd'] }}

- name: Test wpt
run: npm run test:wpt
Expand All @@ -198,7 +191,12 @@ jobs:
NODE_V8_COVERAGE: ${{ inputs.codecov == true && './coverage/tmp' || '' }}
UNDICI_NO_WASM_SIMD: ${{ inputs['no-wasm-simd'] }}

- name: Coverage Report
- name: Coverage summary
if: inputs.codecov == true
run: npm run coverage:report:ci
id: prepare-coverage-report

- name: Upload coverage report to Codecov
if: inputs.codecov == true
uses: codecov/codecov-action@fdcc8476540edceab3de004e990f80d881c6cc00 # v5.5.0
with:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
"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:sqlite": "cross-env NODE_OPTIONS=--experimental-sqlite borp -p \"test/cache-interceptor/*.js\"",
"test:cache-interceptor": "borp -p \"test/cache-interceptor/*.js\"",
"test:cache-interceptor:sqlite": "cross-env NODE_OPTIONS=--experimental-sqlite npm run test:cache-interceptor",
"test:cookies": "borp -p \"test/cookie/*.js\"",
"test:eventsource": "npm run build:node && borp --expose-gc -p \"test/eventsource/*.js\"",
"test:fuzzing": "node test/fuzzing/fuzzing.test.js",
Expand Down
10 changes: 6 additions & 4 deletions test/cache-interceptor/cache-tests.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,11 @@ for (let i = 0; i < testEnvironments.length; i++) {
const port = PORT + i

const promise = new Promise((resolve) => {
const process = fork(join(import.meta.dirname, 'cache-tests-worker.mjs'), {
const cacheTestsWorkerProcess = fork(join(import.meta.dirname, 'cache-tests-worker.mjs'), {
stdio: 'pipe',
env: {
NODE_OPTIONS: process.env.NODE_OPTIONS,
NODE_V8_COVERAGE: process.env.NODE_V8_COVERAGE,
TEST_ENVIRONMENT: JSON.stringify(environment),
BASE_URL: `${PROTOCOL}://localhost:${port}`,
CI: CLI_OPTIONS.values.ci ? 'true' : undefined,
Expand All @@ -148,15 +150,15 @@ for (let i = 0; i < testEnvironments.length; i++) {
})

const stdout = []
process.stdout.on('data', chunk => {
cacheTestsWorkerProcess.stdout.on('data', chunk => {
stdout.push(chunk)
})

process.stderr.on('error', chunk => {
cacheTestsWorkerProcess.stderr.on('error', chunk => {
stdout.push(chunk)
})

process.on('close', code => {
cacheTestsWorkerProcess.on('close', code => {
resolve([code, stdout])
})
})
Expand Down
Loading