Skip to content

Commit

Permalink
WIP: feat(update_backlog): add --preset=promote-not-not-passing
Browse files Browse the repository at this point in the history
TODO: Validate that this is useful.
  • Loading branch information
ErichDonGubler committed Jun 10, 2024
1 parent 7b64a0e commit 95f00d8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
17 changes: 17 additions & 0 deletions moz-webgpu-cts/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ enum OnZeroItem {
enum UpdateBacklogPreset {
/// Remove tests that expect only `PASS` outcomes on all platforms from `backlog`.
PromotePermaPassing,
/// Remove tests that, at most, expect `PASS`, `TIMEOUT`, and `NOTRUN` outcomes from `backlog`.
PromoteNotNotPassing,
}

fn main() -> ExitCode {
Expand Down Expand Up @@ -1434,6 +1436,7 @@ fn run(cli: Cli) -> ExitCode {
enum Case {
#[default]
PermaPass,
NotNotPass,
Other,
}
let mut found_write_err = false;
Expand Down Expand Up @@ -1472,6 +1475,12 @@ fn run(cli: Cli) -> ExitCode {
[(platform, build_profile)];
if let Some(SubtestOutcome::Pass) = expected.as_permanent() {
Case::PermaPass
} else if expected.is_subset(
SubtestOutcome::Pass
| SubtestOutcome::Timeout
| SubtestOutcome::NotRun,
) {
Case::NotNotPass
} else {
Case::Other
}
Expand All @@ -1492,6 +1501,14 @@ fn run(cli: Cli) -> ExitCode {
properties.implementation_status = None;
}
}
UpdateBacklogPreset::PromoteNotNotPassing => {
if matches!(
value_across_all_platforms(),
Ok(Case::PermaPass | Case::NotNotPass)
) {
properties.implementation_status = None;
}
}
}
}
match write_to_file(file_path, metadata::format_file(file)) {
Expand Down
4 changes: 4 additions & 0 deletions moz-webgpu-cts/src/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ where
{
self.inner().is_superset(rep.inner())
}

pub fn is_subset(&self, rep: EnumSet<Out>) -> bool {
self.inner().is_subset(rep)
}
}

impl<Out> Display for Expected<Out>
Expand Down

0 comments on commit 95f00d8

Please sign in to comment.