Skip to content

Commit

Permalink
suite_id replacement
Browse files Browse the repository at this point in the history
CMK-16572
  • Loading branch information
SoloJacobs committed Mar 26, 2024
1 parent f888f6d commit a553b81
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/bin/scheduler/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ impl<'a> BuildStageReporter<'a> {

pub fn update(
&mut self,
suite_id: &str,
rmk_id: &str,
build_status: EnvironmentBuildStage,
) -> AnyhowResult<()> {
self.build_states.insert(suite_id.into(), build_status);
self.build_states.insert(rmk_id.into(), build_status);
BuildStates(&self.build_states).write(&self.path, self.locker)
}
}
2 changes: 1 addition & 1 deletion src/bin/scheduler/scheduling/suites.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn produce_suite_results(suite: &Suite) -> AnyhowResult<SuiteExecutionReport> {
.context("Received termination signal while running suite")?;

Ok(SuiteExecutionReport {
suite_id: suite.id.clone(),
rmk_id: suite.id.clone(),
timestamp: timestamp.timestamp(),
attempts: attempt_reports,
rebot,
Expand Down
2 changes: 1 addition & 1 deletion src/bin/scheduler/setup/rcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ fn run_command_spec_in_session(

fn rcc_setup_failures_human_readable<'a>(failures: impl Iterator<Item = &'a String>) -> String {
failures
.map(|suite_id| suite_id.as_str())
.map(|rmk_id| rmk_id.as_str())
.collect::<Vec<&str>>()
.join(", ")
}
4 changes: 2 additions & 2 deletions src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub struct RCCEnvironment {

impl Environment {
pub fn new(
suite_id: &str,
rmk_id: &str,
rcc_binary_path: &Utf8Path,
environment_config: &EnvironmentConfig,
) -> Self {
Expand All @@ -40,7 +40,7 @@ impl Environment {
binary_path: rcc_binary_path.to_path_buf(),
robot_yaml_path: rcc_environment_config.robot_yaml_path.clone(),
controller: String::from("robotmk"),
space: suite_id.to_string(),
space: rmk_id.to_string(),
build_timeout: rcc_environment_config.build_timeout,
env_json_path: rcc_environment_config.env_json_path.clone(),
}),
Expand Down
2 changes: 1 addition & 1 deletion src/results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub enum EnvironmentBuildStage {

#[derive(Serialize)]
pub struct SuiteExecutionReport {
pub suite_id: String,
pub rmk_id: String,
pub timestamp: i64,
pub attempts: Vec<AttemptReport>,
pub rebot: Option<RebotOutcome>,
Expand Down
6 changes: 3 additions & 3 deletions src/rf/rebot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::fs::{read, read_to_string};
use tokio_util::sync::CancellationToken;

pub struct Rebot<'a> {
pub suite_id: &'a str,
pub rmk_id: &'a str,
pub environment: &'a Environment,
pub session: &'a Session,
pub working_directory: &'a Utf8Path,
Expand Down Expand Up @@ -71,7 +71,7 @@ impl Rebot<'_> {

fn run(&self) -> AnyhowResult<Outcome<i32>> {
self.session.run(&RunSpec {
id: &format!("robotmk_rebot_{}", self.suite_id),
id: &format!("robotmk_rebot_{}", self.rmk_id),
command_spec: &self.environment.wrap(self.build_rebot_command_spec()),
base_path: &self.working_directory.join("rebot"),
timeout: 120,
Expand Down Expand Up @@ -133,7 +133,7 @@ mod tests {
#[test]
fn build_rebot_command() {
let rebot_command_spec = Rebot {
suite_id: "my_suite",
rmk_id: "my_suite",
environment: &Environment::new(
"my_suite",
"/bin/rcc".into(),
Expand Down
2 changes: 1 addition & 1 deletion src/suites.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub fn run_attempts_with_rebot(
}
info!("Suite {id}: Running rebot");
let rebot = Rebot {
suite_id: id,
rmk_id: id,
environment,
session,
working_directory: output_directory,
Expand Down

0 comments on commit a553b81

Please sign in to comment.