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 Aug 1, 2024
1 parent 8dcde14 commit a8422e2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
21 changes: 20 additions & 1 deletion moz-webgpu-cts/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ enum UpdateBacklogSubcommand {
#[clap(long, default_value_t = true)]
only_across_all_platforms: bool,
},
/// Remove tests that, at most, expect `PASS`, `TIMEOUT`, and `NOTRUN` outcomes from `backlog`.
PromoteNotNotPassing,
}

fn main() -> ExitCode {
Expand Down Expand Up @@ -965,6 +967,7 @@ fn run(cli: Cli) -> ExitCode {
enum Case {
#[default]
PermaPass,
NotNotPass,
Other,
}
let mut found_write_err = false;
Expand Down Expand Up @@ -1003,6 +1006,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 @@ -1027,10 +1036,20 @@ fn run(cli: Cli) -> ExitCode {
properties.implementation_status =
Some(cases.map(|case| match case {
Case::PermaPass => ImplementationStatus::Implementing,
Case::Other => ImplementationStatus::Backlog,
Case::NotNotPass | Case::Other => {
ImplementationStatus::Backlog
}
}));
}
}
UpdateBacklogSubcommand::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/wpt/metadata/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,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 a8422e2

Please sign in to comment.