Skip to content
This repository was archived by the owner on Aug 27, 2026. It is now read-only.

Commit 258cc78

Browse files
committed
test(golden): pin current_exe scrub to CARGO_BIN_EXE for custom target dirs
The Windows verifier runs with CARGO_TARGET_DIR=target/windows-verify, so the literal /target/{debug,release}/ scrub missed current_exe and the artifact handoff golden diverged. Scrub the exact binary path reported by CARGO_BIN_EXE_tokenzero to the default layout first; verified against a custom CARGO_TARGET_DIR on Linux.
1 parent 141d630 commit 258cc78

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

crates/tokenzero/tests/golden_outputs.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,13 @@ fn scrub_value(value: &mut Value, temp_root: &Path, refs: &mut RefScrubber) {
366366
fn scrub_temp_path(text: &str, temp_root: &Path) -> String {
367367
let temp = normalize_path(&temp_root.to_string_lossy());
368368
let workspace = normalize_path(&workspace_root().to_string_lossy());
369+
// The CLI under test reports its own binary path (current_exe), which
370+
// moves with CARGO_TARGET_DIR (e.g. target/windows-verify on the Windows
371+
// verifier); pin the exact binary path to the default layout first so the
372+
// golden stays stable under custom target dirs.
373+
let current_exe = normalize_path(env!("CARGO_BIN_EXE_tokenzero"));
369374
normalize_path(text)
375+
.replace(&current_exe, "[WORKSPACE]/target/debug/tokenzero")
370376
.replace(&temp, "[TMP]")
371377
.replace(&workspace, "[WORKSPACE]")
372378
// The runtime's own binary (current_exe) carries a `.exe` suffix on

0 commit comments

Comments
 (0)