* ci: split native-artifact suite and report per-file test timing
node --test runs files concurrently but tests inside a file serially, so
tests/deploy/native-artifact.test.mjs (34 tests, ~80 artifact builds) was a
201s serial floor on every Node suite run. Split it verbatim into build,
install and reuse files with shared helpers.
Add scripts/ci/test-timing-report.mjs, which summarises node:test JUnit
per file, warns on a per-file budget and writes a step summary and JSON.
node-tests and node-compat now emit JUnit through COMMANDER_TEST_JUNIT and
publish the report; node-tests uploads it as an artifact. Both steps are
non-fatal observability and never block the merge gate.
Local full npm test (4 CPU, Node 24.22.1): 219.5s -> 170.2s; largest file
serial time 201s -> 83.5s.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
* ci: fail closed on timing inventory and plan shards offline
Timing-driven shards need complete, trustworthy per-file coverage before any
routing change. Add an offline planner that derives the canonical test-file
inventory from the npm test operands and refuses missing, unknown, duplicate,
unsafe or invalid rows instead of guessing weights.
- scripts/ci/test-shard-plan.mjs: fail-closed audit and deterministic advisory
LPT dry-run partitions; never executes input; refuses input/output aliases;
invalid input preserves existing output.
- tests/ci/test-shard-plan.test.mjs: real-CLI inventory run plus malformed,
duplicate, unknown, tie, zero, count-edge and overflow regressions.
- test-timing-report: reject blank and nonfinite durations, overflowing totals
and nonfinite budgets; order equal files by code unit, not locale.
- Correct the overlapping-timing comment: nested testcase sums are neither a
wall-clock estimate nor a shard lower bound.
- package.json: default JUnit destination becomes a Git-ignored regular file.
Node 24.22.1 fsync on /dev/null raised EINVAL after the suite completed.
Explicit CI destinations and nonzero exits on real failures are unchanged.
- docs/ci-test-timing.md: trust scope, provenance requirements and advisory-only
limits of local measurements.
Local canonical npm test: 1805 tests, 1800 pass, 0 fail, 5 skipped; independent
XML/glob check matched all 223 files exactly once across four dry-run shards.
No speedup, CI-provenance, isolation or provider-lane claim.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
* ci: re-run admission after the operator-approved oversize exception
The policy classifies this PR as oversize because the verbatim native-artifact
split moves 3392 lines. The operator explicitly approved the exception; the
ci:oversize-approved label and the OVERSIZE-JUSTIFICATION line are in place.
This empty commit exists only because pull_request runs are triggered by
synchronize, and pr-policy only reclassifies on a new push. It changes no file.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
* fix(ci): keep a missing file identity visible in timing evidence
The first real corpus from the merged pipeline could not be used, and the
failure was hiding behind a fabricated filename.
Observed on PR #505, run 42560237630 (head dca2c21, attempt 1, runner
commander-ci-oci-h2qr4-runner-bk7cx, node-tests success): the uploaded
node-tests JUnit carried no file attribute on any testcase, so all 1798
testcases collapsed into one row and no time could be attributed to a file.
The canonical node-tests job pins Node 22.23.2; the file attribute exists only
from the Node line that added it (nodejs/node#59432, f0aa073, 24.x). The same
canonical command locally on Node 24.22.1 produced 223 rows with real paths.
- test-timing-report: displayPath returns null instead of inventing
"(unknown file)", so the JSON keeps the gap visible. Markdown still labels the
row "(no file identity)", and rows without identity sort after real paths on
equal time instead of displacing one.
- test-shard-plan: name that case explicitly instead of reporting a generic
unsafe path, because the cause is the reporter's runtime, not bad input.
- docs/ci-test-timing.md: record the measurement, the required runtime, and why
the canonical job must not be moved off its pinned version to obtain a
corpus; a separate timing lane needs its own cost and admission decision.
Verified end to end against the real artifact: the re-extracted report now shows
"(no file identity)" and the planner exits 2 with the runtime message, writing
no output. Focused suites 20/20 pass; lint, lint:sync, graph check and
diff check pass. No weights were invented and no routing changed.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
* fix(ci): collect native per-file timing on the pinned Node runtime
Observe test:summary events in the existing canonical execution and keep
native harness durations distinct from legacy JUnit testcase sums.
Reject incomplete evidence and preserve canonical test selection and routing.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
* fix(ci): accept symlinked roots in the shard inventory guard
realpathSync(absolute) resolves symlinks across the whole path, but the
guard compared it against path.resolve(absolute), which only normalizes.
Under any symlinked root (macOS os.tmpdir(), a symlinked cwd handed to
test-timing-report) every file mismatched and the inventory threw
'unsafe canonical test file'. Compare against the real root instead so
the check still rejects symlinks inside the tree only.
* chore(graph): refresh generated outputs after the shard-plan guard fix
---------
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Fixes: #59422
This PR adds support for the
fileattribute in JUnit XML reporter'stestcaseelements, addressing the missing source file information that is useful for CI/CD platformslike GitLab.
Changes
fileattribute support in JUnit reporter for testcase elementsBackground
The JUnit XML specification supports a
fileattribute ontestcaseelements to indicate the source file containing the test. This attribute was missing from Node.js testrunner's JUnit output, limiting integration with tools that rely on this information for enhanced test reporting.
Before:
Testing
