From 0e4b0fedade7c2512bda5676a8a569e3d83f68f8 Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Mon, 4 May 2026 00:01:02 +0300 Subject: [PATCH 1/8] test: fix tests requiring git core.autocrlf=true on windows Signed-off-by: Nad Alaba <37968805+nadalaba@users.noreply.github.com> --- test/README.md | 3 --- test/parallel/test-snapshot-typescript.js | 8 +++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/test/README.md b/test/README.md index 02359ca68265..61f5b8bda918 100644 --- a/test/README.md +++ b/test/README.md @@ -8,9 +8,6 @@ directory, see [the guide on writing tests](../doc/contributing/writing-tests.md On how to run tests in this directory, see [the contributing guide](../doc/contributing/pull-requests.md#step-6-test). -For the tests to run on Windows, be sure to clone Node.js source code with the -`autocrlf` git config flag set to true. - ## Test Directories | Directory | Runs on CI | Purpose | diff --git a/test/parallel/test-snapshot-typescript.js b/test/parallel/test-snapshot-typescript.js index 98502ccebedf..bed1e1e79dfa 100644 --- a/test/parallel/test-snapshot-typescript.js +++ b/test/parallel/test-snapshot-typescript.js @@ -9,12 +9,13 @@ const { spawnSync } = require('child_process'); const tmpdir = require('../common/tmpdir'); const fixtures = require('../common/fixtures'); const fs = require('fs'); +const os = require('os'); tmpdir.refresh(); const blobPath = tmpdir.resolve('snapshot.blob'); // Concat test/fixtures/snapshot/typescript.js with -// test/fixtures/snapshot/typescript.js into +// test/fixtures/snapshot/typescript-main.js into // tmpdir/snapshot.js. const file = tmpdir.resolve('snapshot.js'); fs.copyFileSync(fixtures.path('snapshot', 'typescript.js'), file); @@ -57,7 +58,8 @@ fs.appendFileSync(file, assert.strictEqual(child.status, 0); const result = fs.readFileSync(outPath, 'utf8'); - const expected = fs.readFileSync( - fixtures.path('snapshot', 'ts-example.js'), 'utf8'); + const expected = fs + .readFileSync(fixtures.path('snapshot', 'ts-example.js'), 'utf8') + .replace(/\r?\n/g, os.EOL); assert.strictEqual(result, expected); } From 158cd25b7c07e215ef1b304a5c773fa0055dfa3c Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Mon, 3 Aug 2026 17:30:48 +0300 Subject: [PATCH 2/8] test: assert tests don't depend on core.autocrlf value --- .github/workflows/coverage-windows.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index b282f03ccb7b..7c8323682f23 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -68,8 +68,12 @@ permissions: jobs: coverage-windows: if: github.event.pull_request.draft == false + strategy: + matrix: + autocrlf: [true, input, false] runs-on: windows-2025 steps: + - run: git config --global core.autocrlf ${{ matrix.autocrlf }} - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false From 7c78ce078ec78233dc90eea7cdb5cfa00b151ac0 Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Mon, 3 Aug 2026 18:38:53 +0300 Subject: [PATCH 3/8] Revert "test: fix tests requiring git core.autocrlf=true on windows" This reverts commit 0e4b0fedade7c2512bda5676a8a569e3d83f68f8. --- test/README.md | 3 +++ test/parallel/test-snapshot-typescript.js | 8 +++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/test/README.md b/test/README.md index 61f5b8bda918..02359ca68265 100644 --- a/test/README.md +++ b/test/README.md @@ -8,6 +8,9 @@ directory, see [the guide on writing tests](../doc/contributing/writing-tests.md On how to run tests in this directory, see [the contributing guide](../doc/contributing/pull-requests.md#step-6-test). +For the tests to run on Windows, be sure to clone Node.js source code with the +`autocrlf` git config flag set to true. + ## Test Directories | Directory | Runs on CI | Purpose | diff --git a/test/parallel/test-snapshot-typescript.js b/test/parallel/test-snapshot-typescript.js index bed1e1e79dfa..98502ccebedf 100644 --- a/test/parallel/test-snapshot-typescript.js +++ b/test/parallel/test-snapshot-typescript.js @@ -9,13 +9,12 @@ const { spawnSync } = require('child_process'); const tmpdir = require('../common/tmpdir'); const fixtures = require('../common/fixtures'); const fs = require('fs'); -const os = require('os'); tmpdir.refresh(); const blobPath = tmpdir.resolve('snapshot.blob'); // Concat test/fixtures/snapshot/typescript.js with -// test/fixtures/snapshot/typescript-main.js into +// test/fixtures/snapshot/typescript.js into // tmpdir/snapshot.js. const file = tmpdir.resolve('snapshot.js'); fs.copyFileSync(fixtures.path('snapshot', 'typescript.js'), file); @@ -58,8 +57,7 @@ fs.appendFileSync(file, assert.strictEqual(child.status, 0); const result = fs.readFileSync(outPath, 'utf8'); - const expected = fs - .readFileSync(fixtures.path('snapshot', 'ts-example.js'), 'utf8') - .replace(/\r?\n/g, os.EOL); + const expected = fs.readFileSync( + fixtures.path('snapshot', 'ts-example.js'), 'utf8'); assert.strictEqual(result, expected); } From 6588b12081ca82274598e34d689cf3b3c60a314a Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Mon, 3 Aug 2026 21:36:31 +0300 Subject: [PATCH 4/8] Revert "test: assert tests don't depend on core.autocrlf value" This reverts commit 158cd25b7c07e215ef1b304a5c773fa0055dfa3c. --- .github/workflows/coverage-windows.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index 7c8323682f23..b282f03ccb7b 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -68,12 +68,8 @@ permissions: jobs: coverage-windows: if: github.event.pull_request.draft == false - strategy: - matrix: - autocrlf: [true, input, false] runs-on: windows-2025 steps: - - run: git config --global core.autocrlf ${{ matrix.autocrlf }} - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false From 5c5b989fd244ea9ec1a77c9202589a236a731bc7 Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Mon, 4 May 2026 00:01:02 +0300 Subject: [PATCH 5/8] test: fix tests requiring git core.autocrlf=true on windows Signed-off-by: Nad Alaba <37968805+nadalaba@users.noreply.github.com> --- test/README.md | 3 --- test/parallel/test-snapshot-typescript.js | 8 +++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/test/README.md b/test/README.md index 02359ca68265..61f5b8bda918 100644 --- a/test/README.md +++ b/test/README.md @@ -8,9 +8,6 @@ directory, see [the guide on writing tests](../doc/contributing/writing-tests.md On how to run tests in this directory, see [the contributing guide](../doc/contributing/pull-requests.md#step-6-test). -For the tests to run on Windows, be sure to clone Node.js source code with the -`autocrlf` git config flag set to true. - ## Test Directories | Directory | Runs on CI | Purpose | diff --git a/test/parallel/test-snapshot-typescript.js b/test/parallel/test-snapshot-typescript.js index 98502ccebedf..bed1e1e79dfa 100644 --- a/test/parallel/test-snapshot-typescript.js +++ b/test/parallel/test-snapshot-typescript.js @@ -9,12 +9,13 @@ const { spawnSync } = require('child_process'); const tmpdir = require('../common/tmpdir'); const fixtures = require('../common/fixtures'); const fs = require('fs'); +const os = require('os'); tmpdir.refresh(); const blobPath = tmpdir.resolve('snapshot.blob'); // Concat test/fixtures/snapshot/typescript.js with -// test/fixtures/snapshot/typescript.js into +// test/fixtures/snapshot/typescript-main.js into // tmpdir/snapshot.js. const file = tmpdir.resolve('snapshot.js'); fs.copyFileSync(fixtures.path('snapshot', 'typescript.js'), file); @@ -57,7 +58,8 @@ fs.appendFileSync(file, assert.strictEqual(child.status, 0); const result = fs.readFileSync(outPath, 'utf8'); - const expected = fs.readFileSync( - fixtures.path('snapshot', 'ts-example.js'), 'utf8'); + const expected = fs + .readFileSync(fixtures.path('snapshot', 'ts-example.js'), 'utf8') + .replace(/\r?\n/g, os.EOL); assert.strictEqual(result, expected); } From a6ee63f01c7a22c96609239dcca8482a54886059 Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Mon, 3 Aug 2026 21:37:58 +0300 Subject: [PATCH 6/8] test: move matrix job to a new testing workflow --- .github/workflows/test-windows.yml | 98 ++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 .github/workflows/test-windows.yml diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml new file mode 100644 index 000000000000..0dcb5126e60d --- /dev/null +++ b/.github/workflows/test-windows.yml @@ -0,0 +1,98 @@ +name: Test Windows + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + paths-ignore: + - '**.md' + - '**.nix' + - eslint.config.mjs + - '**/eslint.config_partial.mjs' + - android-configure + - android-configure.py + - android-patches/** + - benchmarks/** + - doc/** + - pyproject.yml + - tsconfig.json + - test/internet/** + - tools/actions/** + - tools/bootstrap/** + - tools/dep_updaters/** + - tools/doc/** + - tools/eslint-rules/** + - tools/eslint/** + - tools/lint-md/** + - typings/** + - .** + - '!.github/workflows/test-windows.yml' + push: + branches: + - main + paths-ignore: + - '**.md' + - '**.nix' + - eslint.config.mjs + - '**/eslint.config_partial.mjs' + - android-configure + - android-configure.py + - android-patches/** + - benchmarks/** + - doc/** + - pyproject.yml + - tsconfig.json + - test/internet/** + - tools/actions/** + - tools/bootstrap/** + - tools/dep_updaters/** + - tools/doc/** + - tools/eslint-rules/** + - tools/eslint/** + - tools/lint-md/** + - typings/** + - .** + - '!.github/workflows/test-windows.yml' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +env: + PYTHON_VERSION: '3.14' + FLAKY_TESTS: keep_retrying + RUSTC_VERSION: '1.86' + +permissions: + contents: read + +jobs: + test-windows: + if: github.event.pull_request.draft == false + strategy: + matrix: + autocrlf: [true, false] + name: Windows tests (${{ matrix.autocrlf && 'with' || 'without' }} autocrlf) + runs-on: windows-2025 + steps: + - name: Set git config core.autocrlf + run: git config --global core.autocrlf ${{ matrix.autocrlf }} + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + - name: Set up Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 + with: + python-version: ${{ env.PYTHON_VERSION }} + allow-prereleases: true + - name: Install deps + run: choco install nasm + - name: Install Rust ${{ env.RUSTC_VERSION }} + run: | + rustup override set "$RUSTC_VERSION" + rustup --version + - name: Build + run: ./vcbuild.bat clang-cl v8temporal + - name: Test + # run: python tools\test.py --mode=release -p tap --logfile test.tap default pummel' + # change to ./vcbuild.bat noprojgen nobuild test-ci-js when the tests are fixed + run: python3 tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=keep_retrying --measure-flakiness 9 default pummel addons ffi js-native-api node-api embedding benchmark --skip-tests="es-module/test-vm-source-text-module-leak,parallel/test-child-process-exec-any-shells-windows,parallel/test-inspector-wait-for-connection,parallel/test-util-getcallsites-sourcemap" From c784c5523db56ed2b49b4b45bd1f607ed5b0610e Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Mon, 3 Aug 2026 23:09:44 +0300 Subject: [PATCH 7/8] build tests before running --- .github/workflows/test-windows.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 0dcb5126e60d..4f9c9206e4be 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -93,6 +93,7 @@ jobs: - name: Build run: ./vcbuild.bat clang-cl v8temporal - name: Test - # run: python tools\test.py --mode=release -p tap --logfile test.tap default pummel' # change to ./vcbuild.bat noprojgen nobuild test-ci-js when the tests are fixed - run: python3 tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=keep_retrying --measure-flakiness 9 default pummel addons ffi js-native-api node-api embedding benchmark --skip-tests="es-module/test-vm-source-text-module-leak,parallel/test-child-process-exec-any-shells-windows,parallel/test-inspector-wait-for-connection,parallel/test-util-getcallsites-sourcemap" + run: | + ./vcbuild.bat noprojgen nobuild build-addons build-js-native-api-tests build-node-api-tests build-ffi-tests + python3 tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=keep_retrying --measure-flakiness 9 default pummel addons ffi js-native-api node-api embedding benchmark --skip-tests="es-module/test-vm-source-text-module-leak,parallel/test-child-process-exec-any-shells-windows,parallel/test-inspector-wait-for-connection,parallel/test-util-getcallsites-sourcemap" From 97a494b073756b6378312c6a9c1573677512d31b Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Tue, 4 Aug 2026 02:38:43 +0300 Subject: [PATCH 8/8] fix tests paths --- .github/workflows/test-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 4f9c9206e4be..a7059bc35189 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -96,4 +96,4 @@ jobs: # change to ./vcbuild.bat noprojgen nobuild test-ci-js when the tests are fixed run: | ./vcbuild.bat noprojgen nobuild build-addons build-js-native-api-tests build-node-api-tests build-ffi-tests - python3 tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=keep_retrying --measure-flakiness 9 default pummel addons ffi js-native-api node-api embedding benchmark --skip-tests="es-module/test-vm-source-text-module-leak,parallel/test-child-process-exec-any-shells-windows,parallel/test-inspector-wait-for-connection,parallel/test-util-getcallsites-sourcemap" + python3 tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=keep_retrying --measure-flakiness 9 default pummel addons ffi js-native-api node-api embedding benchmark --skip-tests="test-child-process-exec-any-shells-windows"