diff --git a/v2/robotmk/src/bin/scheduler/results.rs b/v2/robotmk/src/bin/scheduler/results.rs index 0eb7fdd0..77b2e5d6 100644 --- a/v2/robotmk/src/bin/scheduler/results.rs +++ b/v2/robotmk/src/bin/scheduler/results.rs @@ -99,7 +99,9 @@ pub enum EnvironmentBuildStatusError { #[derive(Serialize)] pub struct SuiteExecutionReport { pub suite_id: String, - pub outcome: AttemptsOutcome, + pub attempts: Vec, + pub rebot: Option, + pub config: AttemptsConfig, } impl WritePiggybackSection for SuiteExecutionReport { @@ -108,13 +110,6 @@ impl WritePiggybackSection for SuiteExecutionReport { } } -#[derive(Serialize)] -pub struct AttemptsOutcome { - pub attempts: Vec, - pub rebot: Option, - pub config: AttemptsConfig, -} - #[derive(Serialize)] pub enum AttemptOutcome { AllTestsPassed, diff --git a/v2/robotmk/src/bin/scheduler/scheduling/suites.rs b/v2/robotmk/src/bin/scheduler/scheduling/suites.rs index a66758f1..aeeac009 100644 --- a/v2/robotmk/src/bin/scheduler/scheduling/suites.rs +++ b/v2/robotmk/src/bin/scheduler/scheduling/suites.rs @@ -1,6 +1,6 @@ use crate::environment::ResultCode; use crate::internal_config::Suite; -use crate::results::{AttemptOutcome, AttemptsConfig, AttemptsOutcome, SuiteExecutionReport}; +use crate::results::{AttemptOutcome, AttemptsConfig, SuiteExecutionReport}; use crate::rf::{rebot::Rebot, robot::Attempt}; use crate::sessions::session::{RunOutcome, RunSpec}; @@ -13,11 +13,7 @@ use std::fs::create_dir_all; pub fn run_suite(suite: &Suite) -> Result<()> { debug!("Running suite {}", &suite.id); - let report = SuiteExecutionReport { - suite_id: suite.id.clone(), - outcome: produce_suite_results(suite)?, - }; - report + produce_suite_results(suite)? .write( &suite.results_file, suite.host.clone(), @@ -29,7 +25,7 @@ pub fn run_suite(suite: &Suite) -> Result<()> { Ok(()) } -fn produce_suite_results(suite: &Suite) -> Result { +fn produce_suite_results(suite: &Suite) -> Result { let output_directory = suite .working_directory .join(Utc::now().format("%Y-%m-%dT%H.%M.%S%.f%z").to_string()); @@ -41,7 +37,8 @@ fn produce_suite_results(suite: &Suite) -> Result { let (attempt_outcomes, output_paths) = run_attempts_until_succesful(suite, &output_directory)?; - Ok(AttemptsOutcome { + Ok(SuiteExecutionReport { + suite_id: suite.id.clone(), attempts: attempt_outcomes, rebot: if output_paths.is_empty() { None