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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 31 additions & 25 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,20 @@ jobs:
env:
CI: true
NODE_V8_COVERAGE: ${{ inputs.codecov == true && './coverage/tmp' || '' }}

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

- 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' || '' }}

- name: Test node-fetch
run: npm run test:node-fetch
Expand All @@ -85,25 +99,27 @@ jobs:
id: test-cache
env:
CI: true
NODE_V8_COVERAGE: ${{ inputs.codecov == true && './coverage/tmp' || '' }}
NODE_V8_COVERAGE: ${{ inputs.codecov == true && './coverage/tmp' || '' }}

- name: Test cache-interceptor
- name: Test cache-interceptor without sqlite
if: inputs.node-version == '20'
run: npm run test:cache-interceptor
id: test-cache-interceptor
env:
CI: true
NODE_V8_COVERAGE: ${{ inputs.codecov == true && './coverage/tmp' || '' }}

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

- name: Test fetch
run: npm run test:fetch
id: test-fetch
- name: Test interceptors
run: npm run test:interceptors
id: test-interceptors
env:
CI: true
NODE_V8_COVERAGE: ${{ inputs.codecov == true && './coverage/tmp' || '' }}
Expand Down Expand Up @@ -143,13 +159,6 @@ jobs:
CI: true
NODE_V8_COVERAGE: ${{ inputs.codecov == true && './coverage/tmp' || '' }}

- 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' || '' }}

- name: Test cache-tests
run: npm run test:cache-tests
id: test-cache-tests
Expand All @@ -163,14 +172,6 @@ jobs:
env:
CI: true
NODE_V8_COVERAGE: ''

- 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' || '' }}

- name: Test wpt
run: npm run test:wpt
Expand All @@ -179,7 +180,12 @@ jobs:
CI: true
NODE_V8_COVERAGE: ${{ inputs.codecov == true && './coverage/tmp' || '' }}

- 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