From 8108759065447b384cbc1dfaa323ff54b6579f1c Mon Sep 17 00:00:00 2001 From: Erich Gubler Date: Thu, 30 May 2024 18:06:40 -0400 Subject: [PATCH] WIP: feat(update_backlog): add `--preset=promote-not-not-passing` TODO: Validate that this is useful. --- moz-webgpu-cts/src/main.rs | 21 ++++++++++++++++++- moz-webgpu-cts/src/wpt/metadata/properties.rs | 4 ++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/moz-webgpu-cts/src/main.rs b/moz-webgpu-cts/src/main.rs index 6715533..7f49a97 100644 --- a/moz-webgpu-cts/src/main.rs +++ b/moz-webgpu-cts/src/main.rs @@ -150,6 +150,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 { @@ -1461,6 +1463,7 @@ fn run(cli: Cli) -> ExitCode { enum Case { #[default] PermaPass, + NotNotPass, Other, } let mut found_write_err = false; @@ -1499,6 +1502,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 } @@ -1523,10 +1532,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)) { diff --git a/moz-webgpu-cts/src/wpt/metadata/properties.rs b/moz-webgpu-cts/src/wpt/metadata/properties.rs index 8e3eaeb..074106a 100644 --- a/moz-webgpu-cts/src/wpt/metadata/properties.rs +++ b/moz-webgpu-cts/src/wpt/metadata/properties.rs @@ -90,6 +90,10 @@ where { self.inner().is_superset(rep.inner()) } + + pub fn is_subset(&self, rep: EnumSet) -> bool { + self.inner().is_subset(rep) + } } impl Display for Expected