Skip to content

Commit

Permalink
Rename SchedulerState --> SchedulerPhase
Browse files Browse the repository at this point in the history
The latter is more fitting.
  • Loading branch information
jherbel committed Nov 14, 2023
1 parent 3f92019 commit 69cf4a8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions v2/robotmk/src/bin/scheduler/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fn run() -> Result<()> {

setup::general::setup(&global_config, &suites).context("General setup failed")?;
debug!("General setup completed");
write_state(&results::SchedulerState::RCCSetup, &global_config)?;
write_phase(&results::SchedulerPhase::RCCSetup, &global_config)?;
let suites = setup::rcc::setup(&global_config, suites).context("RCC-specific setup failed")?;
debug!("RCC-specific setup completed");

Expand All @@ -57,8 +57,8 @@ fn run() -> Result<()> {
}

info!("Starting environment building");
write_state(
&results::SchedulerState::EnvironmentBuilding,
write_phase(
&results::SchedulerPhase::EnvironmentBuilding,
&global_config,
)?;
let suites = environment::build_environments(&global_config, suites)?;
Expand All @@ -69,16 +69,16 @@ fn run() -> Result<()> {
}

info!("Starting suite scheduling");
write_state(&results::SchedulerState::Scheduling, &global_config)?;
write_phase(&results::SchedulerPhase::Scheduling, &global_config)?;
scheduling::scheduler::run_suites_and_cleanup(&global_config, &suites)
}

fn write_state(
state: &results::SchedulerState,
fn write_phase(
state: &results::SchedulerPhase,
global_config: &internal_config::GlobalConfig,
) -> Result<()> {
state.write(
global_config.results_directory.join("scheduler_state.json"),
global_config.results_directory.join("scheduler_phase.json"),
&global_config.results_directory_locker,
)
}
6 changes: 3 additions & 3 deletions v2/robotmk/src/bin/scheduler/results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ pub fn suite_results_directory(results_directory: &Utf8Path) -> Utf8PathBuf {
}

#[derive(Serialize)]
pub enum SchedulerState {
pub enum SchedulerPhase {
RCCSetup,
EnvironmentBuilding,
Scheduling,
}

impl WriteSection for SchedulerState {
impl WriteSection for SchedulerPhase {
fn name() -> &'static str {
"robotmk_scheduler_state"
"robotmk_scheduler_phase"
}
}

Expand Down

0 comments on commit 69cf4a8

Please sign in to comment.