Skip to content

fix(test): normalize test runner paths to POSIX slashes - #2176

Merged
obviyus merged 1 commit into
openclaw:mainfrom
saiyam-jain-dev:fix/run-node-tests-posix-paths
Nov 11, 2026
Merged

obviyus merged 1 commit into
openclaw:mainfrom
saiyam-jain-dev:fix/run-node-tests-posix-paths

Conversation

@saiyam-jain-dev

@saiyam-jain-dev saiyam-jain-dev commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: on Windows hosts, scripts/run-node-tests.mjs returns paths with Windows backslashes (\) from globSync, causing target expansion and child argument checks in test/run-node-tests.test.ts to fail.

User Impact

Target expansion in the custom test runner produces consistent POSIX relative paths (/) across all platforms.

Why This Change Was Made

resolveTestFiles() maps paths returned by globSync through .replaceAll("\\", "/"). This prevents Windows-specific path separators from breaking target comparisons and child-process argument assertions.

Documentation Impact

README.md already documents that scripts/run-node-tests.mjs expands targets so the same targets work on Linux, macOS, and Windows. No documentation update required. Added changelog fragment changelog.d/run-node-tests-posix-paths.md.

Evidence

  • node --test test/run-node-tests.test.ts: passes 11/11 tests on Windows (previously failed subtests 3 and 10 with AssertionError: ['test\a.test.ts'] vs ['test/a.test.ts']).
  • node scripts/changelog-stitch.mjs --check: passed.
  • oxfmt --check scripts/run-node-tests.mjs changelog.d/run-node-tests-posix-paths.md: passed.
  • oxlint scripts/run-node-tests.mjs: passed with 0 warnings and 0 errors.

Real Behavior Proof

Shipped CLI execution trace on Windows (Node v22.19.0) executing a focused target through the real child process:

> node -v
v22.19.0

> node scripts/run-node-tests.mjs unit --shard 286/317
[run-node-tests] target=unit shard=286/317 concurrency=12 files=1
TAP version 13
# [run-node-tests] target=unit concurrency=4 files=1
# [run-node-tests] target=unit concurrency=12 files=1
# [run-node-tests] target=all shard=1/2 coverage=write concurrency=2 files=1
# Subtest: test runner caps adaptive concurrency at sixteen
ok 1 - test runner caps adaptive concurrency at sixteen
  ---
  duration_ms: 1.1725
  type: 'test'
  ...
# Subtest: test runner environment override is validated and CLI choice takes precedence
ok 2 - test runner environment override is validated and CLI choice takes precedence
  ---
  duration_ms: 0.6338
  type: 'test'
  ...
# Subtest: test runner expands named targets with sorted de-duplicated files
ok 3 - test runner expands named targets with sorted de-duplicated files
  ---
  duration_ms: 16.3817
  type: 'test'
  ...
# Subtest: test runner parses CLI concurrency overrides and forwarded Node options
ok 4 - test runner parses CLI concurrency overrides and forwarded Node options
  ---
  duration_ms: 0.7773
  type: 'test'
  ...
# Subtest: test runner parses shard and coverage modes
ok 5 - test runner parses shard and coverage modes
  ---
  duration_ms: 0.8643
  type: 'test'
  ...
# Subtest: test runner shards partition every file exactly once
ok 6 - test runner shards partition every file exactly once
  ---
  duration_ms: 0.5057
  type: 'test'
  ...
# Subtest: coverage policies keep the established thresholds
ok 7 - coverage policies keep the established thresholds
  ---
  duration_ms: 0.1747
  type: 'test'
  ...
# Subtest: composed no-build scripts preserve standalone build contracts
ok 8 - composed no-build scripts preserve standalone build contracts
  ---
  duration_ms: 0.7701
  type: 'test'
  ...
# Subtest: test runner fails clearly when a target has no files
ok 9 - test runner fails clearly when a target has no files
  ---
  duration_ms: 2.2364
  type: 'test'
  ...
# Subtest: test runner preserves child arguments, exit codes, and terminating signals
ok 10 - test runner preserves child arguments, exit codes, and terminating signals
  ---
  duration_ms: 4.2279
  type: 'test'
  ...
# [run-node-tests] coverage-out=profiles\1 profiles=1 checkout-scripts=2
# [run-node-tests] target=all shard=2/2 coverage=write concurrency=2 files=1
# [run-node-tests] coverage-out=profiles\2 profiles=1 checkout-scripts=2
# [run-node-tests] target=all coverage=replay concurrency=2 files=1
# [run-node-tests] target=all coverage=replay concurrency=2 files=1
# [run-node-tests] target=all coverage=replay concurrency=2 files=1
# Subtest: sharded raw coverage replays into the whole-target thresholds
ok 11 - sharded raw coverage replays into the whole-target thresholds
  ---
  duration_ms: 1156.1235
  type: 'test'
  ...
1..11
# tests 11
# suites 0
# pass 11
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 1337.633

Real Behavior Proof

  • Claim: on Windows, the test runner's target expansion returns POSIX paths, so target and child-argument comparisons match.
  • Surface: scripts/run-node-tests.mjs through test/run-node-tests.test.ts, on a GitHub-hosted windows-latest runner.
  • Run: https://github.com/openclaw/clawsweeper/actions/runs/42971314545. It is a temporary push-triggered workflow on a scratch branch with read-only permissions, with this PR and fix(dashboard): normalize dashboard strict paths to POSIX slashes #2177 cherry-picked onto current main.
  • Observed on main's script: test runner expands named targets with sorted de-duplicated files and test runner preserves child arguments, exit codes, and terminating signals fail with [ 'test\\a.test.ts', 'test\\z.test.ts' ] where [ 'test/a.test.ts', 'test/z.test.ts' ] is expected.
  • Observed with this change: test/run-node-tests.test.ts and test/check-dashboard-strict.test.ts pass 15/15.
  • Limits: the job runs only these two test files, not the full suite, on Windows.

@clawsweeper

clawsweeper Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 6, 2026
@clawsweeper

clawsweeper Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Normalize expanded test-file paths to forward slashes before deduplication and sorting.

Example: Expand the unit target on Windows with test/a.test.ts present.

  • Before: The runner returns test\a.test.ts, failing the existing cross-platform path assertion.
  • After: The runner returns test/a.test.ts and preserves the expected child arguments.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused contract repair supported by a real CLI trace and a supported-version Windows comparison.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The supplied Windows terminal trace executes the shipped wrapper and real Node child successfully on Node 22.19.0; the later native Windows comparison exercises the identical changed runner on supported Node 24.22.1, with the base failing and fixed job passing. Together they support the narrow normalization claim. Raw hosted logs were inaccessible, so detailed hosted assertion output remains a supplied observation rather than independently inspected output.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Windows contributors encounter failing path assertions in the repository's cross-platform test runner.
Reason: The patch restores an existing documented contract without adding options, APIs, or another execution path.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR fixes a Windows test-runner defect still present on current main, with no actionable code findings.

Priority: P2
Reviewed head: 6d17db5349fa441549943c6cf9b93fb7109b6460

Before merge

None.

Findings

None.

Agent review details

How this fits together

Package test commands use this runner to expand named targets, select shards, and pass file arguments to Node's test runner.

flowchart LR
  A[Package test command] --> B[Named target patterns]
  B --> C[Filesystem glob expansion]
  C --> D[Normalize and sort paths]
  D --> E[Select shard]
  E --> F[Node test child]
Loading

Technical review

Best possible solution:

Land the focused normalization in the existing target-expansion owner.

Do we have a high-confidence way to reproduce the issue?

Current-main expansion preserves Windows separators while existing assertions require forward slashes; the linked Windows base/fixed comparison supports this failure path without a new local run.

Is this the best way to solve the issue?

Normalization at expansion is the smallest complete fix and preserves the existing sorting, deduplication, sharding, and child-process owners.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b484f0a485f1.

Provenance checked

  • Test-target expansion keeps the original intent (452f765: Introduce cross-platform glob expansion and sorted test-file lists while reducing repeated validation work.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 0a9f685 adds scripts/run-node-tests.mjs:15 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 0a9f685b77cc; files: scripts/run-node-tests.mjs)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: Repairs Windows test validation with limited impact outside contributor tooling.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-11-07T00:00:53.907Z sha 6d17db5 :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-07T02:12:24.569Z sha 6d17db5 :: needs real behavior proof before merge. :: none

Reviewed November 11, 2026, 1:22 AM ET / 06:22 UTC (Revision 3).

@saiyam-jain-dev

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 7, 2026
@obviyus

obviyus commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 11, 2026
@obviyus
obviyus merged commit cf2623d into openclaw:main Nov 11, 2026
40 checks passed
obviyus added a commit that referenced this pull request Nov 14, 2026
* fix(review): qualify exact push relay rejection fixture

* fix: report the real checkout inspection failure reason

- Lead the read-only checkout inspection failure message with the runner error when present.
- Keep a redacted 2000-character stdout/stderr tail as context; keep stderr || stdout when no error.
- OpenClaw prints a plugin trust warning to stderr on every run, which hid every inspection reason.
- Add runner tests for OpenClaw and Codex inspection failures.

* fix: qualify the historical OCE harness origin fixture (#2197)

* test: clear dashboard token watchdog after completion (#2196)

Co-authored-by: Ryan Saari <[email protected]>

* fix: qualify exact OCE 5398 JDBC fixture revisions (#2198)

* fix(dashboard): normalize dashboard strict paths to POSIX slashes (#2177)

* fix: use server-issued census observation windows (#2174)

* fix: bound census observations with server-issued query windows

Replace cross-host completion-clock comparisons for negotiated census producers with stored metadata and per-assignment observation windows. Preserve strict legacy fallback, lease/checkpoint/identity fences, stable witnesses, and capacity bounds. Include signed native temporal red/green and rolling-compatibility proof.

Co-authored-by: brokemac79 <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>

* fix: use server-issued census observation windows

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 9c3c62ec-951b-43b0-98f9-511dba1829cf

* fix: preserve negotiated census authority across legacy upgrades

Add real workerd cold-restart proof that persisted deployed legacy-v2 checkpoints, cursors, identities and receipts load unchanged and safely continue through negotiated windows. Require the atomic lease mode before accepting any page, including legacy-shaped in-flight data before next issues a witness. Resolves the accepted data-model compatibility proof blocker without state reset or weakened legacy guards.

Co-authored-by: brokemac79 <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>

* Publish openclaw/coverage-observation-window-fix

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 281f1b7a-6346-42af-b919-9fd25dd6b736

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: brokemac79 <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>

* fix(test): normalize test runner paths to POSIX slashes (#2176)

* fix: terminal acknowledgement test passes on a timeout instead of the real retry failure (#2199)

* test: exercise terminal acknowledgement retries without delay

* test: use the real retry helper with Retry-After: 0

The retry helper honors Retry-After, so the fixture no longer needs a
patched copy of the helper and request builder. The unchanged workflow
step and helper now run all six attempts without waiting.

Co-authored-by: Ryan Saari <[email protected]>
Co-authored-by: obviyus <[email protected]>

---------

Co-authored-by: Ryan Saari <[email protected]>
Co-authored-by: obviyus <[email protected]>

* improve: shorten reservation workflow test runtime (#2200)

* test: avoid reservation fixture retry waits

* test: record reservation retry waits with a PATH sleep shim

Replace the BASH_ENV sleep function and the hand-maintained per-scenario
attempt table with a sleep shim on the step's PATH. Every recorded delay
is still checked against the workflow's 2n + 0..3 backoff, and the
service-unavailable scenario must record all four waits.

Co-authored-by: Ryan Saari <[email protected]>
Co-authored-by: obviyus <[email protected]>

---------

Co-authored-by: Ryan Saari <[email protected]>
Co-authored-by: obviyus <[email protected]>

* fix(review): stop demanding proof for speculative races and in-flight revocation (#2202)

* fix(review): stop demanding proof for speculative races and in-flight revocation

Authority-chain review now triggers only on changed authorization
decisions; revocation applies to the next request; unproven authority is
no longer a merge gate. P3 findings are advisory, speculative race
machinery without recorded buy-in and preemptive single-use helpers become
findings, and AGENTS.md adopts the matching design rules.

Co-authored-by: obviyus <[email protected]>

* fix(review): keep advisory P3 findings out of the merge readiness gate

Co-authored-by: obviyus <[email protected]>

* fix(review): keep P3-only incorrect verdicts and queued repairs advisory

Co-authored-by: obviyus <[email protected]>

---------

Co-authored-by: obviyus <[email protected]>

* fix: reuse reviewed test credentials after surrounding edits (#2201)

Approve exact previously reviewed synthetic Raw/RawV2 value pairs while retaining detector, decoder, native metadata, verification, and completion checks. Remove hostname-based exemptions and keep normalized Postgres findings blocking.

Validation: full pnpm check, 32 focused tests, 28 native proof cases in an isolated UTM guest, and a clean final committed whole-branch Codex review. The maintainer explicitly waived the hosted ClawSweeper review and approved this merge in the task conversation.

* feat(review): read durable Gitcrawl cluster service context

* fix(review): validate service tokens without control regex

* fix: allow service-backed review-start reservations

* style: format service review-start reservation proof

* fix: allow service-backed review artifact publication

* feat: prepare service context before applying decisions

* fix: preserve parent identity during apply preparation

* fix: wire apply preparation to the shared relation policy

* test: cover service-backed apply and authority drift

* test: hold paired closes without prepared service context

* test: align service apply fixtures with live revision guards

* docs: explain apply preparation failure ownership

* fix: enforce apply retry guards without mutation receipts

* style: format service freshness assertion

* test: exercise service retries with a current review lease

* fix: refresh apply authority after ambiguous writes

* style: format service lease regression fixture

* test: reject exact-event retries after lease revocation

* style: format exact-event retry assertion

---------

Co-authored-by: Mitchell Etzel <[email protected]>
Co-authored-by: Free Wortley <[email protected]>
Co-authored-by: Ryan S <[email protected]>
Co-authored-by: Ryan Saari <[email protected]>
Co-authored-by: Saiyam Jain <[email protected]>
Co-authored-by: RoboClaw <[email protected]>
Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: brokemac79 <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: obviyus <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants