Skip to content

Commit aae0004

Browse files
authored
Merge pull request #10549 from Extra-Chill/fix/10548-hermetic-env-removals
2 parents db25f5a + e8ae316 commit aae0004

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

tests/stale_linked_rig_recovery.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,19 @@ fn hermetic_fixture_command_cannot_use_operator_paths_or_installed_homeboy() {
2929
let command = context.command(TestBinary::HomeboyFixture);
3030
let configured_env = command
3131
.get_envs()
32-
.map(|(key, value)| {
33-
(
34-
key.to_string_lossy().into_owned(),
35-
value
36-
.expect("hermetic context only sets values")
37-
.to_string_lossy()
38-
.into_owned(),
39-
)
32+
.filter_map(|(key, value)| {
33+
value.map(|value| {
34+
(
35+
key.to_string_lossy().into_owned(),
36+
value.to_string_lossy().into_owned(),
37+
)
38+
})
4039
})
4140
.collect::<std::collections::BTreeMap<_, _>>();
41+
let removed_env = command
42+
.get_envs()
43+
.filter_map(|(key, value)| value.is_none().then(|| key.to_string_lossy().into_owned()))
44+
.collect::<std::collections::BTreeSet<_>>();
4245

4346
assert_eq!(
4447
command.get_program(),
@@ -62,6 +65,8 @@ fn hermetic_fixture_command_cannot_use_operator_paths_or_installed_homeboy() {
6265
configured_env["HOMEBOY_RUNTIME_TMPDIR"],
6366
context.runtime_dir().display().to_string()
6467
);
68+
assert!(removed_env.contains(homeboy_core::observation::SOURCE_SNAPSHOT_METADATA_ENV));
69+
assert!(removed_env.contains(homeboy_core::observation::LAB_OFFLOAD_METADATA_ENV));
6570
assert!(context.config_dir().starts_with(context.root()));
6671
assert!(context.data_dir().starts_with(context.root()));
6772
assert!(context.artifact_dir().starts_with(context.root()));

0 commit comments

Comments
 (0)