Skip to content

Commit

Permalink
Extend scheduler system test to check plan working directory handling
Browse files Browse the repository at this point in the history
1) Working directories of plans that are no long configured should be
   removed.
2) Already existing plan directories of configured plans should not be
   emptied.

CMK-18459
  • Loading branch information
jherbel committed Aug 23, 2024
1 parent 694fd81 commit 0f141be
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,19 @@ use walkdir::WalkDir;
#[ignore]
async fn test_scheduler() -> AnyhowResult<()> {
let test_dir = Utf8PathBuf::from(var("TEST_DIR")?);
let unconfigured_plan_working_dir = test_dir
.join("working")
.join("plans")
.join("should_be_removed_during_scheduler_setup");
let configured_plan_previous_execution_dir = test_dir
.join("working")
.join("plans")
.join("rcc_headless")
.join("should_still_exist_after_scheduler_run");
create_dir_all(&test_dir)?;
create_dir_all(&unconfigured_plan_working_dir)?;
create_dir_all(&configured_plan_previous_execution_dir)?;

#[cfg(windows)]
let current_user_name = var("UserName")?;
let config = create_config(
Expand Down Expand Up @@ -59,6 +71,8 @@ async fn test_scheduler() -> AnyhowResult<()> {
&current_user_name,
)
.await?;
assert!(!unconfigured_plan_working_dir.exists());
assert!(configured_plan_previous_execution_dir.is_dir());
assert_results_directory(&config.results_directory);
assert_managed_directory(
&config.managed_directory,
Expand Down

0 comments on commit 0f141be

Please sign in to comment.