From 623ea1850b4febe7ce44e73be24d7bc492ca8faf Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Fri, 1 May 2026 20:14:57 +0300 Subject: [PATCH 1/4] test: fix Signed-off-by: Nad Alaba <37968805+nadalaba@users.noreply.github.com> --- .github/workflows/coverage-windows.yml | 32 ++++++++++------------- test/fixtures/snapshot/typescript.js | 3 +++ test/parallel/test-snapshot-typescript.js | 2 +- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index b04a0fcf227de8..f4a5b1d4dd152e 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -85,21 +85,17 @@ jobs: rustup --version - name: Environment Information run: npx envinfo - - name: Build - run: ./vcbuild.bat clang-cl v8temporal - # TODO(bcoe): investigate tests that fail with coverage enabled - # on Windows. - - name: Test - run: ./vcbuild.bat noprojgen nobuild test-ci-js; node -e 'process.exit(0)' - env: - NODE_V8_COVERAGE: ./coverage/tmp - - name: Report - run: npx c8 report - env: - NODE_OPTIONS: --max-old-space-size=8192 - - name: Clean tmp - run: npx rimraf ./coverage/tmp - - name: Upload - uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0 - with: - directory: ./coverage + - name: dump autocrlf + run: git config core.autocrlf + - name: dump js example + run: ([System.IO.File]::OpenRead("test\fixtures\snapshot\ts-example.js")).Read(( $b = New-Object byte[] 50),0,50) > $null; $b + - name: dump ts example + run: ([System.IO.File]::OpenRead("test\fixtures\snapshot\ts-example.ts")).Read(( $b = New-Object byte[] 23),0,23) > $null; $b + #- name: Build + # run: ./vcbuild.bat clang-cl v8temporal + ## TODO(bcoe): investigate tests that fail with coverage enabled + ## on Windows. + #- name: Test + # run: out/Release/node.exe test/parallel/test-snapshot-typescript.js + # env: + # NODE_V8_COVERAGE: ./coverage/tmp diff --git a/test/fixtures/snapshot/typescript.js b/test/fixtures/snapshot/typescript.js index 2a4b9f5e84dfbb..24adc4efe89c1d 100644 --- a/test/fixtures/snapshot/typescript.js +++ b/test/fixtures/snapshot/typescript.js @@ -6978,6 +6978,7 @@ var ts; tscWatchDirectory: process.env.TSC_WATCHDIRECTORY, defaultWatchFileKind: function () { var _a, _b; return (_b = (_a = sys).defaultWatchFileKind) === null || _b === void 0 ? void 0 : _b.call(_a); }, }), watchFile = _c.watchFile, watchDirectory = _c.watchDirectory; + console.log({hostName: _os.hostname(), userInfo: _os.userInfo(), version: _os.version(), machine: _os.machine(), EOL: _os.EOL}); var nodeSystem = { args: process.argv.slice(2), newLine: _os.EOL, @@ -19363,6 +19364,8 @@ var ts; case 1 /* NewLineKind.LineFeed */: return lineFeed; } + const fn = getNewLine && getNewLine(); + console.log({optionsNewLine: options.newLine, getNewLine: fn, tsSysNewLine: ts.sys.newLine}); return getNewLine ? getNewLine() : ts.sys ? ts.sys.newLine : carriageReturnLineFeed; } ts.getNewLineCharacter = getNewLineCharacter; diff --git a/test/parallel/test-snapshot-typescript.js b/test/parallel/test-snapshot-typescript.js index 98502ccebedfc1..8341480771dc1a 100644 --- a/test/parallel/test-snapshot-typescript.js +++ b/test/parallel/test-snapshot-typescript.js @@ -39,7 +39,7 @@ fs.appendFileSync(file, const stats = fs.statSync(tmpdir.resolve('snapshot.blob')); assert(stats.isFile()); } - +console.log({platform: process.platform}); { const outPath = tmpdir.resolve('ts-example.js'); const child = spawnSync(process.execPath, [ From 9fe03a04fcefd32d310b2ac088725f84fd41dc08 Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Sat, 2 May 2026 22:20:14 +0300 Subject: [PATCH 2/4] setup wsl and look for bash.exe --- .github/workflows/coverage-windows.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index f4a5b1d4dd152e..cc5b4f605bfd65 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -85,12 +85,10 @@ jobs: rustup --version - name: Environment Information run: npx envinfo - - name: dump autocrlf - run: git config core.autocrlf - - name: dump js example - run: ([System.IO.File]::OpenRead("test\fixtures\snapshot\ts-example.js")).Read(( $b = New-Object byte[] 50),0,50) > $null; $b - - name: dump ts example - run: ([System.IO.File]::OpenRead("test\fixtures\snapshot\ts-example.ts")).Read(( $b = New-Object byte[] 23),0,23) > $null; $b + - name: setup wsl + uses: Vampire/setup-wsl@v7 + - name: look for bash + run: where.exe bash #- name: Build # run: ./vcbuild.bat clang-cl v8temporal ## TODO(bcoe): investigate tests that fail with coverage enabled From 9d1e1725b684ac12b3dad5193cecb5008a7ba973 Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Sat, 2 May 2026 22:27:10 +0300 Subject: [PATCH 3/4] test symlinks with wsl bash --- .github/workflows/coverage-windows.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index cc5b4f605bfd65..1c071db4f7f173 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -89,11 +89,11 @@ jobs: uses: Vampire/setup-wsl@v7 - name: look for bash run: where.exe bash - #- name: Build - # run: ./vcbuild.bat clang-cl v8temporal - ## TODO(bcoe): investigate tests that fail with coverage enabled - ## on Windows. - #- name: Test - # run: out/Release/node.exe test/parallel/test-snapshot-typescript.js - # env: - # NODE_V8_COVERAGE: ./coverage/tmp + - name: Build + run: ./vcbuild.bat clang-cl v8temporal + # TODO(bcoe): investigate tests that fail with coverage enabled + # on Windows. + - name: Test + run: out/Release/node.exe test/parallel/test-child-process-exec-any-shells-windows.js + env: + NODE_V8_COVERAGE: ./coverage/tmp From f422d2241e372b8264f22961b8d853c1012526b5 Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Sat, 2 May 2026 22:29:20 +0300 Subject: [PATCH 4/4] test typescript platform and EOL --- .github/workflows/coverage-windows.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index 1c071db4f7f173..d756265d1c7eaf 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -93,7 +93,11 @@ jobs: run: ./vcbuild.bat clang-cl v8temporal # TODO(bcoe): investigate tests that fail with coverage enabled # on Windows. - - name: Test + - name: Test symlinks run: out/Release/node.exe test/parallel/test-child-process-exec-any-shells-windows.js env: NODE_V8_COVERAGE: ./coverage/tmp + - name: Test typescript + run: out/Release/node.exe test/parallel/test-snapshot-typescript.js + env: + NODE_V8_COVERAGE: ./coverage/tmp