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

Function test_walltime_executor_in_working_dir

src/executor/tests.rs:286–313  ·  view source on GitHub ↗
(#[values(false, true)] enable_profiler: bool)

Source from the content-addressed store, hash-verified

284 #[rstest::rstest]
285 #[test_log::test(tokio::test)]
286 async fn test_walltime_executor_in_working_dir(#[values(false, true)] enable_profiler: bool) {
287 let (_permit, mut executor) = get_walltime_executor().await;
288
289 let cmd = r#"
290if [ "$(basename "$(pwd)")" != "within_sub_directory" ]; then
291 echo "FAIL: Working directory is not 'within_sub_directory'"
292 exit 1
293fi
294"#;
295
296 let mut config = walltime_config(cmd, enable_profiler);
297
298 let dir = TempDir::new().unwrap();
299 config.working_directory = Some(
300 dir.path()
301 .join("within_sub_directory")
302 .to_string_lossy()
303 .to_string(),
304 );
305 std::fs::create_dir_all(config.working_directory.as_ref().unwrap()).unwrap();
306
307 // Unset GITHUB_ACTIONS to force LocalProvider which supports repository_override
308 temp_env::async_with_vars(&[("GITHUB_ACTIONS", None::<&str>)], async {
309 let (execution_context, _temp_dir) = create_test_setup(config).await;
310 executor.run(&execution_context, &None).await.unwrap();
311 })
312 .await;
313 }
314
315 // Ensure that commands that fail actually fail
316 #[rstest::rstest]

Callers

nothing calls this directly

Calls 5

get_walltime_executorFunction · 0.85
walltime_configFunction · 0.85
create_test_setupFunction · 0.85
pathMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected