diff --git a/Cargo.toml b/Cargo.toml index 3ea8562..8f90b3f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -82,7 +82,12 @@ zombienet-sdk = { git = "https://github.com/paritytech/zombienet-sdk.git", rev = [profile.bench] inherits = "release" -lto = true codegen-units = 1 +lto = true + +[profile.production] +inherits = "release" +codegen-units = 1 +lto = true [workspace.lints.clippy] diff --git a/crates/report-processor/src/main.rs b/crates/report-processor/src/main.rs index ba9d060..ae6fa46 100644 --- a/crates/report-processor/src/main.rs +++ b/crates/report-processor/src/main.rs @@ -70,7 +70,7 @@ fn main() -> Result<()> { case_idx: case_idx.into_inner(), mode: Cow::Borrowed(mode), }, - Cow::Borrowed(status), + Status::from(status), ) }) .collect::(); @@ -118,7 +118,7 @@ fn main() -> Result<()> { Ok(()) } -type Expectations<'a> = BTreeMap, Cow<'a, TestCaseStatus>>; +type Expectations<'a> = BTreeMap, Status>; /// A tool that's used to process the reports generated by the retester binary in various ways. #[derive(Clone, Debug, Parser)] @@ -156,6 +156,33 @@ pub enum Cli { }, } +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] +pub enum Status { + Succeeded, + Failed, + Ignored, +} + +impl From for Status { + fn from(value: TestCaseStatus) -> Self { + match value { + TestCaseStatus::Succeeded { .. } => Self::Succeeded, + TestCaseStatus::Failed { .. } => Self::Failed, + TestCaseStatus::Ignored { .. } => Self::Ignored, + } + } +} + +impl<'a> From<&'a TestCaseStatus> for Status { + fn from(value: &'a TestCaseStatus) -> Self { + match value { + TestCaseStatus::Succeeded { .. } => Self::Succeeded, + TestCaseStatus::Failed { .. } => Self::Failed, + TestCaseStatus::Ignored { .. } => Self::Ignored, + } + } +} + #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct JsonFile { path: PathBuf,