Keep approval test targets in the temporary home (#33185)

## What changed

Resolve approval test targets outside the workspace relative to the test's
temporary home instead of the process working directory. This keeps the targets
outside the test workspace while containing them in the test environment.

GitOrigin-RevId: 871e840d658468c56d603afc10cc226f918bba5a
This commit is contained in:
Adam Perry @ OpenAI
2026-07-14 22:31:57 +00:00
committed by copyberry
parent 42c5d3c80d
commit be0e0d791a
+1 -4
View File
@@ -53,7 +53,6 @@ use pretty_assertions::assert_eq;
use regex_lite::Regex;
use serde_json::Value;
use serde_json::json;
use std::env;
use std::fs;
#[cfg(unix)]
use std::os::unix::fs::PermissionsExt;
@@ -83,9 +82,7 @@ impl TargetPath {
(path, name.to_string())
}
TargetPath::OutsideWorkspace(name) => {
let path = env::current_dir()
.expect("current dir should be available")
.join(name);
let path = test.home.path().join(name);
(path.clone(), path.display().to_string())
}
}