debug: log environment variable before running cargo run

Signed-off-by: Lars Wirzenius <liw@liw.fi>
This commit is contained in:
Lars Wirzenius
2024-04-15 18:38:17 +03:00
parent 0d455cfba8
commit ffa4142822
+12 -1
View File
@@ -175,8 +175,16 @@ impl TestCase {
}
println!("run adapter with cargo run");
println!("self.envs start");
for (name, value) in self.envs.iter() {
println!(" {name}={value:?}");
}
println!("self.envs end");
let adapter = Command::new("cargo")
.args(["run", "-q"])
.env_clear()
.envs(self.envs.iter())
.stdin(File::open(&req_filename)?)
.output()?;
@@ -333,7 +341,10 @@ impl TestCaseBuilder {
// Set up the requested environment with RAD_HOME and
// RAD_PASSPHRASE set to the right values.
let mut envs = HashMap::new();
let mut envs: HashMap<String, String> = std::env::vars()
.filter(|(k, _)| k != "RADICLE_NATIVE_CI" && !k.starts_with("RAD_"))
.collect();
assert!(!envs.contains_key("RADICLE_NATIVE_CI"));
envs.insert("RAD_HOME".into(), format!("{}", rad.home().display()));
envs.insert("RAD_PASSPHRASE".into(), Rad::PASSPHRASE.into());