fix: Windows-only test failures invisible to the Linux-only CI (tilde/canonicalize fixtures) #64

Closed
opened 2026-08-05 12:37:31 +02:00 by buildagent · 0 comments
Member

Source: discovered running the full workspace suite on Windows (CI is Linux-only by design).

Symptom

These pass on Linux and FAIL on Windows, so the Linux-only CI never catches them:

  • code-index-cli / tests/link_tilde_e2e.rs: tilde_link_resolves_against_home_through_the_real_cli, link_add_accepts_a_tilde_path_and_list_resolves_it
  • code-index-indexer / config::tests::expand_tilde_forms

Root cause (test fixtures — the product is correct)

  • The link tests compared the CLI's canonical_path (correctly \\?\-stripped by display_path) against a raw Path::canonicalize(), which on Windows keeps the verbatim \\?\ prefix.
  • expand_tilde_forms passed a Unix home /home/u, which is NOT absolute on Windows, so expand_tilde correctly refused it (USERPROFILE-not-absolute).

Fix (implemented, pending commit)

  • link tests: strip the verbatim prefix from the expected value (no-op on Linux) so they assert the display contract the CLI actually emits.
  • expand_tilde_forms: use a platform-absolute home (C:\home\u on Windows) and build expected paths via join.

Follow-up worth considering

The Linux-only CI is blind to an entire class of Windows path bugs. A Windows CI job (even just cargo test on a Windows runner) would catch these at the source rather than in manual dogfooding.

**Source:** discovered running the full workspace suite on Windows (CI is Linux-only by design). ## Symptom These pass on Linux and FAIL on Windows, so the Linux-only CI never catches them: - `code-index-cli` / `tests/link_tilde_e2e.rs`: `tilde_link_resolves_against_home_through_the_real_cli`, `link_add_accepts_a_tilde_path_and_list_resolves_it` - `code-index-indexer` / `config::tests::expand_tilde_forms` ## Root cause (test fixtures — the product is correct) - The link tests compared the CLI's `canonical_path` (correctly `\\?\`-stripped by `display_path`) against a raw `Path::canonicalize()`, which on Windows keeps the verbatim `\\?\` prefix. - `expand_tilde_forms` passed a Unix home `/home/u`, which is NOT absolute on Windows, so `expand_tilde` correctly refused it (USERPROFILE-not-absolute). ## Fix (implemented, pending commit) - link tests: strip the verbatim prefix from the expected value (no-op on Linux) so they assert the display contract the CLI actually emits. - `expand_tilde_forms`: use a platform-absolute home (`C:\home\u` on Windows) and build expected paths via `join`. ## Follow-up worth considering The Linux-only CI is blind to an entire class of Windows path bugs. A Windows CI job (even just `cargo test` on a Windows runner) would catch these at the source rather than in manual dogfooding.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
h-dv/code-index#64
No description provided.