Update the format of the expectations file

This commit is contained in:
Omar Abdulla
2026-01-15 17:45:50 +03:00
parent 996a64d500
commit 87dd5edeb1
2 changed files with 35 additions and 3 deletions
+6 -1
View File
@@ -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]
+29 -2
View File
@@ -70,7 +70,7 @@ fn main() -> Result<()> {
case_idx: case_idx.into_inner(),
mode: Cow::Borrowed(mode),
},
Cow::Borrowed(status),
Status::from(status),
)
})
.collect::<Expectations>();
@@ -118,7 +118,7 @@ fn main() -> Result<()> {
Ok(())
}
type Expectations<'a> = BTreeMap<TestSpecifier<'a>, Cow<'a, TestCaseStatus>>;
type Expectations<'a> = BTreeMap<TestSpecifier<'a>, 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<TestCaseStatus> 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<T> {
path: PathBuf,