Repository navigation
test(rust): make the test harness portable to Windows - #1190
Merged
Merged
Conversation
A Windows path embedded raw in a TOML basic string is an invalid escape, and raw in a command template shlex strips its backslashes. Serialize with toml and shlex instead. Open files writable before set_modified, which Windows refuses on a read-only handle.
Hook fixtures derived basename and root-relative path by splitting on
'/', so on Windows the whole backslash path landed unescaped in the
JSON payload. Normalize separators in the hook before splitting, keep
{path} out of JSON in the run_on_file test, compute the watch helper's
relative path with '/' against either root form, and give run_parser a
cwd that exists on every OS.
skip-changelog: test-only change inside #[cfg(test)] modules
thekevinbot
force-pushed
the
claude/1186-win-test-harness
branch
from
October 2, 2026 00:03
8fa9965 to
1f7d4eb
Compare
thekevinbot
force-pushed
the
claude/1186-win-test-harness
branch
from
October 2, 2026 00:40
1f7d4eb to
ba7a360
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1186
Test-harness fixes for Windows. No product code changes; the two
packages/rust/srcedits are inside#[cfg(test)]modules.Every change is to a test that encoded a Unix assumption, not to what the test asserts:
extensions.rs: the fixture extension path is serialized withtoml::Valueinstead of pasted into a basic string, whereD:\a\...was an invalid escape.persist_parsed_path_table.rs: native paths in the parser command template go throughshlex::try_quote, since shlex was stripping their backslashes.set_modifiednow runs on a handle opened for writing, because Windows refuses it on a read-only one.cli_e2e,cli_integration,config_root_derivation,declared_table_name,from_config,repeatable_config,sdk): these computed basename and root-relative path by splitting{path}on/. On Windows the whole backslash path ended up unescaped in the JSON payload. The hooks now normalize\to/before splitting.run_on_file_passes_absolute_path_for_path_placeholderwrites the received{path}to a side file and compares it byte-for-byte, so the path no longer has to survive JSON.run_on_file_does_not_substitute_abspathdrops its vestigial{path}argument.watch_scan_correctness.rs: the helper strips either the given or the canonical root (on Windows these differ:C:\Users\RUNNER~1\...vs\\?\C:\Users\runneradmin\...) and joins the relative path with/.parsed_vtab::run_parser_substitutes_the_absolute_path_and_the_root: the root isstd::env::temp_dir()instead of/tmp, which does not exist on Windows (os error 267).Windows failure count
Before (run 35995035941 on #1178): 99. After (run 36432881839): 63.
Every remaining failure belongs to another issue:
db::tests::files_under,process_file_event_*,relative_root_canonicalizes, vtab tests,path_table_query/gitignore/globsrelative paths,watch_scan_correctnessdir_renamed_within_rootanddir_moved_out_of_root(eventfile_pathhas backslashes),extension_resolution::select_loadable_rejects_an_ambiguous_package.path_table::testsabsolute/home/parent,path_table_globsabsolute,path_table_cli_e2e,path_table_queryabsolute.printf '[{}]'brace expansion and verbatim\\?\paths reaching hooks. Thirteen tests, listed in the issue.E2E Verification
packages/python/e2e-attestations/<branch>.jsonreceipt written (just e2e-attest-python)packages/ts/e2e-attestations/<branch>.jsonreceipt written (just e2e-attest-ts)just e2e-attest-python,just e2e-attest-ts,cargo test --features clion the touched targets,just preflight#[cfg(test)]edits underpackages/rust/src.Changelog / Migrations
skip-changelog:on a commit: test-only change