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
99 changes: 99 additions & 0 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
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
# 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="test-child-process-exec-any-shells-windows"
3 changes: 0 additions & 3 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
8 changes: 5 additions & 3 deletions test/parallel/test-snapshot-typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Loading