MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / test_memory_executor_forwards_path

Function test_memory_executor_forwards_path

src/executor/tests.rs:456–478  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

454
455 #[test_log::test(tokio::test)]
456 async fn test_memory_executor_forwards_path() {
457 let custom_path = "/custom/test/path";
458 let current_path = std::env::var("PATH").unwrap();
459 let modified_path = format!("{custom_path}:{current_path}");
460
461 let cmd = format!(
462 r#"
463if ! echo "$PATH" | grep -q "{custom_path}"; then
464 echo "FAIL: PATH does not contain custom path {custom_path}"
465 echo "Got PATH: $PATH"
466 exit 1
467fi
468"#
469 );
470 let config = memory_config(&cmd);
471 let (execution_context, _temp_dir) = create_test_setup(config).await;
472 let (_permit, _lock, mut executor) = get_memory_executor().await;
473
474 temp_env::async_with_vars(&[("PATH", Some(&modified_path))], async {
475 executor.run(&execution_context, &None).await.unwrap();
476 })
477 .await;
478 }
479}

Callers

nothing calls this directly

Calls 4

memory_configFunction · 0.85
create_test_setupFunction · 0.85
get_memory_executorFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected