nodejs/node
Testing is dominated by the bespoke Python harness `tools/test.py`, which discovers suites under `test/<suite>/`, applies per-suite `.status` files for SKIP/SLOW/FLAKY expectations, and shells out to the built `node` binary per test file. There is no Vitest/Jest; the stack tag is misleading. Native code is covered by `cctest` (googletest) and the `js-native-api`/`node-api`/`addons` suites, which require a build step before they can run. Coverage is collected by nyc/c8 with `.nycrc` thresholds of 95% lines/statements and 93% branches, uploaded to Codecov from two Linux workflows. The new subsystems are well covered at the JS level — ~121 `test-vfs-*` files in `test/parallel` alone plus a dedicated `test/ffi/` suite — but SEA-specific paths are explicitly excluded from coverage.
- The harness is `tools/test.py`, a Python 3 runner invoked as `./tools/test.py --flaky-tests keep_retrying -p actions -j 4`; suites are directories under `test/` and each may carry a `<section>.status` file read by `ReadConfigurationInto`.
- `test/root.status` encodes mode-dependent expectations (e.g. a long list of `parallel/test-*: SLOW` entries under `[$mode==debug]`), and `test/ffi/ffi.status` skips `test-ffi-calls`, `test-ffi-shared-buffer`, and `test-ffi-weakref-calls` on Solaris/SmartOS where bundled libffi callbacks crash.
- `test/parallel` is by far the largest suite (~4976 files), followed by `test/fixtures` (~6108 support files), `test/es-module` (246), `test/addons` (185), `test/sequential` (125), `test/module-hooks` (114), and `test/test-runner` (113).
- VFS has roughly 121 dedicated files in `test/parallel` covering per-API parity (`test-vfs-fs-mkdirSync`, `test-vfs-fs-copyFileSync`, `test-vfs-fs-createReadStream`), edge cases (`test-vfs-bigint-position`, `test-vfs-ctime-update`), and an explicit `test-vfs-fs-matches-real-fs` differential test.
- FFI has its own compiled suite `test/ffi/` with a `fixture_library`, a `testcfg.py`, and permission-focused tests: `test-ffi-permissions.js`, `test-ffi-permission-allow-cli.js`, `test-ffi-permission-audit.js`, `test-ffi-permission-drop.js`, plus `test-ffi-vfs.js` for the load-from-bytes path.
- Running the JS suites requires native build steps first: `make jstest` depends on `build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests build-ffi-tests` — running `tools/test.py` on a clean tree will fail those suites.
- `make cctest` runs the C++ googletest binary built from `test/cctest/` (37 files) and is a separate gate from the JS suites.
- CI suite composition is `CI_JS_SUITES = $(JS_SUITES) pummel` and `CI_NATIVE_SUITES = $(NATIVE_SUITES) benchmark`, with `doctool` conditionally appended; `make test-ci` runs all three plus the prerequisite builds.
- `.github/workflows/test-linux.yml` builds on ubuntu-24.04 and ubuntu-24.04-arm with clang-19, Python 3.14, Rust 1.88 and sccache, runs `make build-ci` then `make test-ci -j1 TEST_CI_ARGS="-p actions --measure-flakiness 9"`.
- CI asserts test hygiene two ways: a `git add -A && git diff --exit-code --staged` step fails the build if running tests dirtied the tree, and the whole suite is re-run from a directory named with spaces, quotes, and non-ASCII characters to catch path-handling bugs.
- Coverage thresholds are declared in `.nycrc` — 95% lines, 95% statements, 93% branches — over `lib/` only, with `test/`, `tools/`, `benchmark/`, and `deps/` excluded.
- Codecov is configured to wait for two coverage builds (`coverage-linux.yml` and `coverage-linux-without-intl.yml`; the Windows one is noted as manually disabled) and both project and patch status gates are turned off, so coverage is informational rather than blocking.
- `test/common/index.js` exposes capability predicates that tests use to self-skip — `hasCrypto`, `hasIntl`, `hasFullICU`, `hasTemporal`, `hasDtls`, `hasQuic`, `hasSQLite`, `hasFFI`, `hasInspector`, `hasLocalStorage` — so conditionally-compiled bindings do not produce false failures.
- SEA-plus-VFS initialisation is explicitly uncovered: `internal/vfs/sea.js` opens with `/* c8 ignore start -- SEA VFS initialization requires an actual SEA binary */`, so that path is exercised only by the separate `test/sea` suite (43 files), not by line coverage.
- Recent commit history shows active flake management (`test: deflake test-bench-errors`, `test-http2-debug`, `test-benchmark-crypto`) alongside a `label-flaky-test-issue.yml` workflow and `--measure-flakiness 9` in CI.