Skip to content

fix(e2e): resolve inspected artifact with platform exe suffix (#202) - #204

Closed
emmanuelm41 wants to merge 1 commit into
mainfrom
fix/windows-e2e-exe-suffix
Closed

fix(e2e): resolve inspected artifact with platform exe suffix (#202)#204
emmanuelm41 wants to merge 1 commit into
mainfrom
fix/windows-e2e-exe-suffix

Conversation

@emmanuelm41

Copy link
Copy Markdown
Member

Closes #202.

Problem

The Windows e2e arm (#82) failed multi-dep and rust-workspace at the binary-inspection verify step even though the binaries ran fine (exit 0, correct stdout):

verify.failure_reason = "binary inspection: artifact not found at
  `C:/.../test-projects/multi-dep\./target/release/multi-dep`"

Two harness-only issues in crates/kache-e2e/src/runner.rs::inspect_binary:

  1. It checked cwd.join("./target/release/foo").exists(), but on Windows the real artifact is foo.exe — the platform exe suffix was never applied.
  2. Path::join left mixed \.// separators in the reported path.

Fix

  • New artifact_candidates(path, exe_suffix) — pure, no filesystem — tidies the path with the existing portable_path() helper, then yields <path> followed by <path><EXE_SUFFIX> (skipping a double suffix). Testable on any host.
  • New resolve_artifact(path) uses std::env::consts::EXE_SUFFIX and returns the first candidate that exists on disk.
  • inspect_binary now resolves via resolve_artifact and reports the not-found path through portable_path for clean separators.

No-op on Unix (EXE_SUFFIX is empty), mirroring the exe_suffix matrix var already used in ci.yml.

Tests

Added 5 unit tests for the candidate/resolve logic. cargo fmt, cargo clippy --all-targets, and cargo test -p kache-e2e (25 passed) all green locally.

Validation: the Windows e2e arm is non-blocking and runs on the self-hosted kunobi-windows runner; this PR's CI run will exercise it.

@emmanuelm41
emmanuelm41 force-pushed the fix/windows-e2e-exe-suffix branch from a7e762e to fa48199 Compare June 1, 2026 23:22
@emmanuelm41
emmanuelm41 marked this pull request as draft June 1, 2026 23:26
On Windows the binary-inspection step in `inspect_binary` looked for the
run artifact at the fixture's suffix-less verify path
(`./target/release/foo`), but the real file is `foo.exe`. `multi-dep` and
`rust-workspace` therefore failed verify with "binary inspection:
artifact not found" even though the binary ran fine (exit 0, correct
stdout). The `Path::join` also left mixed `\.`/`/` separators in the
reported path.

Add `artifact_candidates` (pure, testable) + `resolve_artifact`: tidy the
path via `portable_path`, then try `<path>` and `<path><EXE_SUFFIX>` in
order, picking the first that exists. No-op on Unix (EXE_SUFFIX is empty).
@emmanuelm41

Copy link
Copy Markdown
Member Author

Superseded by #209, which consolidates the remaining Windows e2e fixes (this PR's changes are included there as a dedicated commit) so the whole arm can be driven to green in one CI run. Closing in favor of #209.

@emmanuelm41 emmanuelm41 closed this Jun 2, 2026
@emmanuelm41
emmanuelm41 deleted the fix/windows-e2e-exe-suffix branch June 2, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows e2e: harness binary-inspection looks for the artifact without .exe

1 participant