(#[values(false, true)] enable_profiler: bool)
| 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#" |
| 290 | if [ "$(basename "$(pwd)")" != "within_sub_directory" ]; then |
| 291 | echo "FAIL: Working directory is not 'within_sub_directory'" |
| 292 | exit 1 |
| 293 | fi |
| 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] |
nothing calls this directly
no test coverage detected