Skip to content

Commit 4e2c500

Browse files
committed
chore: add test to ensure path is properly forwarded
1 parent 9b3fd10 commit 4e2c500

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

src/executor/tests.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,4 +417,29 @@ mod memory {
417417
)
418418
.await;
419419
}
420+
421+
#[test_log::test(tokio::test)]
422+
async fn test_memory_executor_forwards_path() {
423+
let custom_path = "/custom/test/path";
424+
let current_path = std::env::var("PATH").unwrap();
425+
let modified_path = format!("{custom_path}:{current_path}");
426+
427+
let cmd = format!(
428+
r#"
429+
if ! echo "$PATH" | grep -q "{custom_path}"; then
430+
echo "FAIL: PATH does not contain custom path {custom_path}"
431+
echo "Got PATH: $PATH"
432+
exit 1
433+
fi
434+
"#
435+
);
436+
let config = memory_config(&cmd);
437+
let (execution_context, _temp_dir) = create_test_setup(config).await;
438+
let (_permit, _lock, executor) = get_memory_executor().await;
439+
440+
temp_env::async_with_vars(&[("PATH", Some(&modified_path))], async {
441+
executor.run(&execution_context, &None).await.unwrap();
442+
})
443+
.await;
444+
}
420445
}

0 commit comments

Comments
 (0)