diff --git a/.github/workflows/push.yml b/.github/workflows/ci.yml similarity index 70% rename from .github/workflows/push.yml rename to .github/workflows/ci.yml index 0385b34..814d11c 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,19 @@ -name: CI (push) - -on: [push] +name: CI +on: [push, pull_request] jobs: + + block-autosquash-commits: + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.0.0 + - name: Block merging fixup commits + uses: ErichDonGubler/block-fixup-merge-action@patch-1 + check: name: Check + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name runs-on: ${{ matrix.os }} strategy: matrix: @@ -29,6 +38,7 @@ jobs: test: name: Test Suite + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name runs-on: ${{ matrix.os }} strategy: matrix: @@ -53,6 +63,7 @@ jobs: fmt: name: Rustfmt + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name runs-on: ubuntu-latest strategy: matrix: @@ -77,6 +88,7 @@ jobs: clippy: name: Clippy + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name runs-on: ubuntu-latest strategy: matrix: @@ -102,6 +114,7 @@ jobs: rustdoc: name: Documentation + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name runs-on: ubuntu-latest strategy: matrix: @@ -128,6 +141,7 @@ jobs: args: --all-features --no-deps cargo-deny: + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name runs-on: ubuntu-latest steps: - uses: actions/checkout@v4.0.0 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml deleted file mode 100644 index c70a57e..0000000 --- a/.github/workflows/pr.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: CI (PR) - -on: [pull_request] -jobs: - block-autosquash-commits: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4.0.0 - - name: Block merging fixup commits - uses: ErichDonGubler/block-fixup-merge-action@patch-1 - diff --git a/moz-webgpu-cts/src/main.rs b/moz-webgpu-cts/src/main.rs index 172aa9d..ba62847 100644 --- a/moz-webgpu-cts/src/main.rs +++ b/moz-webgpu-cts/src/main.rs @@ -40,6 +40,7 @@ use joinery::JoinableIterator; use miette::{miette, Diagnostic, IntoDiagnostic, NamedSource, Report, SourceSpan, WrapErr}; use path_dsl::path; use rayon::prelude::{IntoParallelIterator, ParallelIterator}; +use shared::Browser; use wax::Glob; use whippit::{ metadata::SectionHeader, @@ -51,8 +52,10 @@ use whippit::{ #[derive(Debug, Parser)] #[command(about, version)] struct Cli { - #[clap(long)] - gecko_checkout: Option, + #[clap(long, alias = "gecko-checkout")] + checkout: Option, + #[clap(value_enum, long, default_value = "firefox")] + browser: Browser, #[clap(subcommand)] subcommand: Subcommand, } @@ -60,20 +63,20 @@ struct Cli { #[derive(Debug, Parser)] enum Subcommand { /// Adjust expected test outcomes in metadata, optionally using `wptreport.json` reports from - /// CI runs covering Firefox's implementation of WebGPU. + /// CI runs covering your browser's implementation of WebGPU. /// - /// As Firefox's behavior changes, one generally expects CTS test outcomes to change. When you - /// are testing your own changes in CI, you can use this subcommand to update expected outcomes - /// automatically with the following steps: + /// As your browser's behavior changes, one generally expects CTS test outcomes to change. When + /// you are testing your own changes in CI, you can use this subcommand to update expected + /// outcomes automatically with the following steps: /// - /// 1. Run `moz-webgpu-cts update-expected --preset=new-fx …` against the first complete set of - /// reports you gather from CI with your new Firefox build. This will adjust for new + /// 1. Run `moz-webgpu-cts update-expected --preset=new-build …` against the first complete set + /// of reports you gather from CI with your new browser build. This will adjust for new /// permanent outcomes, and may capture some (but not all) intermittent outcomes. /// /// 2. There may still exist intermittent issues that you do not discover in CI run(s) from the /// previous step. As you discover them in further CI runs on the same build of Firefox, /// adjust expected outcomes to match by running `moz-webgpu-cts update-expected - /// --preset=same-fx …` against the runs' new reports. Repeat as necessary. + /// --preset=same-build …` against the runs' new reports. Repeat as necessary. /// /// With both steps, you may delete the local copies of these reports after being processed /// with `update-expected`. You should not need to re-process them unless you have made an @@ -107,9 +110,11 @@ enum Subcommand { enum ReportProcessingPreset { /// alias: `new-fx` #[value(alias("new-fx"))] + #[value(alias("new-build"))] ResetContradictory, /// alias: `same-fx` #[value(alias("same-fx"))] + #[value(alias("same-build"))] Merge, ResetAll, } @@ -131,14 +136,12 @@ fn main() -> ExitCode { fn run(cli: Cli) -> ExitCode { let Cli { - gecko_checkout, + browser, + checkout, subcommand, } = cli; - let gecko_checkout = match gecko_checkout - .map(Ok) - .unwrap_or_else(search_for_moz_central_ckt) - { + let checkout = match checkout.map(Ok).unwrap_or_else(search_for_repo_root) { Ok(ckt_path) => ckt_path, Err(AlreadyReportedToCommandline) => return ExitCode::FAILURE, }; @@ -244,7 +247,7 @@ fn run(cli: Cli) -> ExitCode { log::trace!("working with the following WPT report files: {exec_report_paths:#?}"); log::info!("working with {} WPT report files", exec_report_paths.len()); - let meta_files_by_path = match read_and_parse_all_metadata(&gecko_checkout) + let meta_files_by_path = match read_and_parse_all_metadata(browser, &checkout) .collect::, _>>() { Ok(paths) => paths, @@ -276,7 +279,7 @@ fn run(cli: Cli) -> ExitCode { for (path, file) in meta_files_by_path { let File { properties, tests } = file; - let file_rel_path = path.strip_prefix(&gecko_checkout).unwrap(); + let file_rel_path = path.strip_prefix(&checkout).unwrap(); file_props_by_file.insert( Utf8PathBuf::from(file_rel_path.to_str().unwrap()), @@ -289,7 +292,8 @@ fn run(cli: Cli) -> ExitCode { subtests, } = test; - let test_path = TestPath::from_fx_metadata_test(file_rel_path, &name).unwrap(); + let test_path = + TestPath::from_metadata_test(browser, file_rel_path, &name).unwrap(); let freak_out_do_nothing = |what: &dyn Display| { log::error!("hoo boy, not sure what to do yet: {what}") @@ -402,7 +406,7 @@ fn run(cli: Cli) -> ExitCode { for entry in entries { let TestExecutionEntry { test_name, result } = entry; - let test_path = TestPath::from_execution_report(&test_name).unwrap(); + let test_path = TestPath::from_execution_report(browser, &test_name).unwrap(); let TestEntry { entry: test_entry, subtests: subtest_entries, @@ -682,8 +686,8 @@ fn run(cli: Cli) -> ExitCode { let mut files = BTreeMap::::new(); for (test_path, (properties, subtests)) in recombined_tests_iter { let name = test_path.test_name().to_string(); - let rel_path = Utf8PathBuf::from(test_path.rel_metadata_path_fx().to_string()); - let path = gecko_checkout.join(&rel_path); + let rel_path = Utf8PathBuf::from(test_path.rel_metadata_path().to_string()); + let path = checkout.join(&rel_path); let file = files.entry(path).or_insert_with(|| File { properties: file_props_by_file .get(&rel_path) @@ -751,7 +755,7 @@ fn run(cli: Cli) -> ExitCode { } Subcommand::Fixup => { log::info!("fixing up metadata in-place…"); - let err_found = read_and_parse_all_metadata(&gecko_checkout) + let err_found = read_and_parse_all_metadata(browser, &checkout) .map(|res| { res.and_then(|(path, mut file)| { for test in file.tests.values_mut() { @@ -789,7 +793,7 @@ fn run(cli: Cli) -> ExitCode { inner: Test, } let mut err_found = false; - let tests_by_name = read_and_parse_all_metadata(&gecko_checkout) + let tests_by_name = read_and_parse_all_metadata(browser, &checkout) .map_ok( |( path, @@ -799,11 +803,12 @@ fn run(cli: Cli) -> ExitCode { }, )| { tests.into_iter().map({ - let gecko_checkout = &gecko_checkout; + let checkout = &checkout; move |(name, inner)| { let SectionHeader(name) = &name; - let test_path = TestPath::from_fx_metadata_test( - path.strip_prefix(gecko_checkout).unwrap(), + let test_path = TestPath::from_metadata_test( + browser, + path.strip_prefix(checkout).unwrap(), name, ) .unwrap(); @@ -1353,13 +1358,17 @@ fn run(cli: Cli) -> ExitCode { } fn read_and_parse_all_metadata( - gecko_checkout: &Path, + browser: Browser, + checkout: &Path, ) -> impl Iterator, metadata::File), AlreadyReportedToCommandline>> { - let webgpu_cts_meta_parent_dir = - path!(gecko_checkout | "testing" | "web-platform" | "mozilla" | "meta" | "webgpu"); + let webgpu_cts_meta_parent_dir = match browser { + Browser::Firefox => { + path!(&checkout | "testing" | "web-platform" | "mozilla" | "meta" | "webgpu") + } + Browser::Servo => path!(&checkout | "tests" | "wpt" | "webgpu" | "meta" | "webgpu"), + }; - let raw_metadata_files = - read_gecko_files_at(gecko_checkout, &webgpu_cts_meta_parent_dir, "**/*.ini"); + let raw_metadata_files = read_files_at(checkout, &webgpu_cts_meta_parent_dir, "**/*.ini"); let mut started_parsing = false; raw_metadata_files.filter_map(move |res| { @@ -1420,20 +1429,20 @@ fn render_metadata_parse_errors<'a>( } /// Returns a "naturally" sorted list of files found by searching for `glob_pattern` in `base`. -/// `gecko_checkout` is stripped as a prefix from the absolute paths recorded into `log` entries -/// emitted by this function. +/// `checkout` is stripped as a prefix from the absolute paths recorded into `log` entries emitted +/// by this function. /// /// # Returns /// -/// An iterator over [`Result`]s containing either a Gecko file's path and contents as a UTF-8 +/// An iterator over [`Result`]s containing either a checkout file's path and contents as a UTF-8 /// string, or the sentinel of an error encountered for the same file that is already reported to /// the command line. /// /// # Panics /// -/// This function will panick if `gecko_checkout` cannot be stripped as a prefix of `base`. -fn read_gecko_files_at( - gecko_checkout: &Path, +/// This function will panick if `checkout` cannot be stripped as a prefix of `base`. +fn read_files_at( + checkout: &Path, base: &Path, glob_pattern: &str, ) -> impl Iterator> { @@ -1447,7 +1456,7 @@ fn read_gecko_files_at( Err(e) => { let path_disp = e .path() - .map(|p| format!(" in {}", p.strip_prefix(gecko_checkout).unwrap().display())); + .map(|p| format!(" in {}", p.strip_prefix(checkout).unwrap().display())); let path_disp: &dyn Display = match path_disp.as_ref() { Some(disp) => disp, None => &"", @@ -1469,7 +1478,7 @@ fn read_gecko_files_at( "working with these files: {:#?}", paths .iter() - .map(|f| f.strip_prefix(gecko_checkout).unwrap()) + .map(|f| f.strip_prefix(checkout).unwrap()) .collect::>() ); @@ -1494,11 +1503,11 @@ fn read_gecko_files_at( .chain(file_read_iter.into_iter().flatten()) } -/// Search for a `mozilla-central` checkout either via Mercurial or Git, iterating from the CWD to +/// Search for source code repository root either via Mercurial or Git, iterating from the CWD to /// its parent directories. /// /// This function reports to `log` automatically, so no meaningful [`Err`] value is returned. -fn search_for_moz_central_ckt() -> Result { +fn search_for_repo_root() -> Result { use lets_find_up::{find_up_with, FindUpKind, FindUpOptions}; let find_up_opts = || FindUpOptions { @@ -1506,7 +1515,7 @@ fn search_for_moz_central_ckt() -> Result kind: FindUpKind::Dir, }; let find_up = |repo_tech_name, root_dir_name| { - log::debug!("searching for {repo_tech_name} checkout of `mozilla-central`…"); + log::debug!("searching for {repo_tech_name} repository root…"); let err = || { miette!( "failed to find a {} repository ({:?}) in {}", @@ -1533,13 +1542,13 @@ fn search_for_moz_central_ckt() -> Result Err(e2) => { log::warn!("{e:?}"); log::warn!("{e2:?}"); - log::error!("failed to find a Gecko repository root"); + log::error!("failed to automatically find a repository root"); Err(AlreadyReportedToCommandline) } })?; log::info!( - "detected Gecko repository root at {}", + "detected repository root at {}", gecko_source_root.display() ); diff --git a/moz-webgpu-cts/src/shared.rs b/moz-webgpu-cts/src/shared.rs index 9fc65f7..c24b287 100644 --- a/moz-webgpu-cts/src/shared.rs +++ b/moz-webgpu-cts/src/shared.rs @@ -9,6 +9,7 @@ use std::{ use camino::{Utf8Component, Utf8Path}; +use clap::ValueEnum; use enum_map::EnumMap; use enumset::{EnumSet, EnumSetType}; use format::lazy_format; @@ -437,23 +438,33 @@ const SCOPE_DIR_FX_PRIVATE_STR: &str = "testing/web-platform/mozilla"; const SCOPE_DIR_FX_PRIVATE_COMPONENTS: &[&str] = &["testing", "web-platform", "mozilla"]; const SCOPE_DIR_FX_PUBLIC_STR: &str = "testing/web-platform"; const SCOPE_DIR_FX_PUBLIC_COMPONENTS: &[&str] = &["testing", "web-platform"]; +const SCOPE_DIR_SERVO_PUBLIC_STR: &str = "tests/wpt/webgpu"; +const SCOPE_DIR_SERVO_PUBLIC_COMPONENTS: &[&str] = &["tests", "wpt", "webgpu"]; impl<'a> TestPath<'a> { pub fn from_execution_report( + browser: Browser, test_url_path: &'a str, ) -> Result> { let err = || ExecutionReportPathError { test_url_path }; - let Some((scope, path)) = test_url_path - .strip_prefix("/_mozilla/") - .map(|stripped| (TestScope::FirefoxPrivate, stripped)) - .or_else(|| { - test_url_path - .strip_prefix('/') - .map(|stripped| (TestScope::Public, stripped)) - }) - else { + + let try_strip_with = |prefix, visibility| { + test_url_path + .strip_prefix(prefix) + .map(|stripped| (visibility, stripped)) + }; + let vis_and_path = match browser { + Browser::Firefox => try_strip_with("/_mozilla/", TestVisibility::Private), + Browser::Servo => try_strip_with("/_webgpu/", TestVisibility::Public), + } + .or_else(|| try_strip_with("/", TestVisibility::Public)); + let Some((visibility, path)) = vis_and_path else { return Err(err()); }; + let scope = TestScope { + browser, + visibility, + }; if path.contains('\\') { return Err(err()); @@ -477,7 +488,8 @@ impl<'a> TestPath<'a> { }) } - pub fn from_fx_metadata_test( + pub fn from_metadata_test( + browser: Browser, rel_meta_file_path: &'a Path, test_name: &'a str, ) -> Result> { @@ -497,15 +509,22 @@ impl<'a> TestPath<'a> { .ok_or(err())?, ); - let (scope, path) = { - if let Ok(path) = rel_meta_file_path.strip_prefix(SCOPE_DIR_FX_PRIVATE_STR) { - (TestScope::FirefoxPrivate, path) - } else if let Ok(path) = rel_meta_file_path.strip_prefix(SCOPE_DIR_FX_PUBLIC_STR) { - (TestScope::Public, path) - } else { - return Err(err()); - } + let (private_path, public_path) = match browser { + Browser::Firefox => (SCOPE_DIR_FX_PRIVATE_STR, SCOPE_DIR_FX_PUBLIC_STR), + Browser::Servo => (SCOPE_DIR_FX_PRIVATE_STR, SCOPE_DIR_SERVO_PUBLIC_STR), + }; + let (visibility, path) = if let Ok(path) = rel_meta_file_path.strip_prefix(private_path) { + (TestVisibility::Private, path) + } else if let Ok(path) = rel_meta_file_path.strip_prefix(public_path) { + (TestVisibility::Public, path) + } else { + return Err(err()); + }; + let scope = TestScope { + browser, + visibility, }; + let Ok(path) = path.strip_prefix("meta/") else { return Err(err()); }; @@ -571,9 +590,15 @@ impl<'a> TestPath<'a> { scope, } = self; lazy_format!(move |f| { - let scope_prefix = match scope { - TestScope::Public => "", - TestScope::FirefoxPrivate => "_mozilla/", + let TestScope { + browser, + visibility, + } = scope; + let scope_prefix = match (browser, visibility) { + (Browser::Firefox, TestVisibility::Public) => "", + (Browser::Firefox, TestVisibility::Private) => "_mozilla/", + (Browser::Servo, TestVisibility::Public) => "_webgpu/", + (Browser::Servo, TestVisibility::Private) => todo!(), }; write!(f, "{scope_prefix}{}", path.components().join_with('/'))?; if let Some(variant) = variant.as_ref() { @@ -583,16 +608,22 @@ impl<'a> TestPath<'a> { }) } - pub(crate) fn rel_metadata_path_fx(&self) -> impl Display + '_ { + pub(crate) fn rel_metadata_path(&self) -> impl Display + '_ { let Self { path, variant: _, scope, } = self; - let scope_dir = match scope { - TestScope::Public => SCOPE_DIR_FX_PUBLIC_COMPONENTS, - TestScope::FirefoxPrivate => SCOPE_DIR_FX_PRIVATE_COMPONENTS, + let TestScope { + browser, + visibility, + } = scope; + let scope_dir = match (browser, visibility) { + (Browser::Firefox, TestVisibility::Public) => SCOPE_DIR_FX_PUBLIC_COMPONENTS, + (Browser::Firefox, TestVisibility::Private) => SCOPE_DIR_FX_PRIVATE_COMPONENTS, + (Browser::Servo, TestVisibility::Public) => SCOPE_DIR_SERVO_PUBLIC_COMPONENTS, + (Browser::Servo, TestVisibility::Private) => todo!(), } .iter() .chain(&["meta"]) @@ -641,60 +672,101 @@ impl Display for MetadataTestPathError<'_> { } } -/// Symbolically represents a file root from which tests and metadata are based. -#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] -pub(crate) enum TestScope { +#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, ValueEnum)] +pub(crate) enum Browser { + Firefox, + Servo, +} + +#[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] +pub(crate) enum TestVisibility { /// A public test available at some point in the history of [WPT upstream]. Note that while /// a test may be public, metadata associated with it is in a private location. /// /// [WPT upstream]: https://github.com/web-platform-tests/wpt Public, - /// A private test specific to Firefox. - FirefoxPrivate, + /// A private test specific to browser. + Private, +} + +/// Symbolically represents a file root from which tests and metadata are based. +#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] +pub(crate) struct TestScope { + browser: Browser, + visibility: TestVisibility, } #[test] fn parse_test_path() { assert_eq!( - TestPath::from_fx_metadata_test( + TestPath::from_metadata_test( + Browser::Firefox, Path::new("testing/web-platform/mozilla/meta/blarg/cts.https.html.ini"), "cts.https.html?stuff=things" ) .unwrap(), TestPath { - scope: TestScope::FirefoxPrivate, + scope: TestScope { + browser: Browser::Firefox, + visibility: TestVisibility::Private + }, path: Utf8Path::new("blarg/cts.https.html").into(), variant: Some("?stuff=things".into()), } ); assert_eq!( - TestPath::from_fx_metadata_test( + TestPath::from_metadata_test( + Browser::Firefox, Path::new("testing/web-platform/meta/stuff/things/cts.https.html.ini"), "cts.https.html" ) .unwrap(), TestPath { - scope: TestScope::Public, + scope: TestScope { + browser: Browser::Firefox, + visibility: TestVisibility::Public + }, path: Utf8Path::new("stuff/things/cts.https.html").into(), variant: None, } ); + + assert_eq!( + TestPath::from_metadata_test( + Browser::Servo, + Path::new("tests/wpt/webgpu/meta/webgpu/cts.https.html.ini"), + "cts.https.html?stuff=things" + ) + .unwrap(), + TestPath { + scope: TestScope { + browser: Browser::Servo, + visibility: TestVisibility::Public + }, + path: Utf8Path::new("webgpu/cts.https.html").into(), + variant: Some("?stuff=things".into()), + } + ); } #[test] fn report_meta_match() { macro_rules! assert_test_matches_meta { - ($test_run_path:expr, $rel_meta_path:expr, $test_section_header:expr) => { + ($browser:expr, $test_run_path:expr, $rel_meta_path:expr, $test_section_header:expr) => { assert_eq!( - TestPath::from_execution_report($test_run_path).unwrap(), - TestPath::from_fx_metadata_test(Path::new($rel_meta_path), $test_section_header) - .unwrap() + TestPath::from_execution_report($browser, $test_run_path).unwrap(), + TestPath::from_metadata_test( + $browser, + Path::new($rel_meta_path), + $test_section_header + ) + .unwrap() ); assert_eq!( format!( "/{}", - TestPath::from_execution_report($test_run_path) + TestPath::from_execution_report($browser, $test_run_path) .unwrap() .runner_url_path() ), @@ -704,31 +776,50 @@ fn report_meta_match() { } assert_test_matches_meta!( + Browser::Firefox, "/_mozilla/blarg/cts.https.html?stuff=things", "testing/web-platform/mozilla/meta/blarg/cts.https.html.ini", "cts.https.html?stuff=things" ); assert_test_matches_meta!( + Browser::Firefox, "/blarg/cts.https.html?stuff=things", "testing/web-platform/meta/blarg/cts.https.html.ini", "cts.https.html?stuff=things" ); + + assert_test_matches_meta!( + Browser::Servo, + "/_webgpu/webgpu/cts.https.html?stuff=things", + "tests/wpt/webgpu/meta/webgpu/cts.https.html.ini", + "cts.https.html?stuff=things" + ); } #[test] fn report_meta_reject() { macro_rules! assert_test_rejects_meta { - ($test_run_path:expr, $rel_meta_path:expr, $test_section_header:expr) => { + ( + $browser: expr, + $test_run_path:expr, + $rel_meta_path:expr, + $test_section_header:expr + ) => { assert_ne!( - TestPath::from_execution_report($test_run_path).unwrap(), - TestPath::from_fx_metadata_test(Path::new($rel_meta_path), $test_section_header) - .unwrap() + TestPath::from_execution_report($browser, $test_run_path).unwrap(), + TestPath::from_metadata_test( + $browser, + Path::new($rel_meta_path), + $test_section_header + ) + .unwrap() ) }; } assert_test_rejects_meta!( + Browser::Firefox, "/blarg/cts.https.html?stuff=things", // Wrong: the `mozilla` component shouldn't be after `web-platform` "testing/web-platform/mozilla/meta/blarg/cts.https.html.ini", @@ -736,6 +827,7 @@ fn report_meta_reject() { ); assert_test_rejects_meta!( + Browser::Firefox, "/_mozilla/blarg/cts.https.html?stuff=things", // Wrong: missing the `mozilla` component after `web-platform` "testing/web-platform/meta/blarg/cts.https.html.ini", @@ -746,7 +838,8 @@ fn report_meta_reject() { #[test] fn runner_url_path() { assert_eq!( - TestPath::from_fx_metadata_test( + TestPath::from_metadata_test( + Browser::Firefox, Path::new("testing/web-platform/meta/blarg/stuff.https.html.ini"), "stuff.https.html" ) @@ -757,7 +850,8 @@ fn runner_url_path() { ); assert_eq!( - TestPath::from_fx_metadata_test( + TestPath::from_metadata_test( + Browser::Firefox, Path::new("testing/web-platform/meta/blarg/stuff.https.html.ini"), "stuff.https.html?win" ) @@ -768,7 +862,8 @@ fn runner_url_path() { ); assert_eq!( - TestPath::from_fx_metadata_test( + TestPath::from_metadata_test( + Browser::Firefox, Path::new("testing/web-platform/mozilla/meta/blarg/stuff.https.html.ini"), "stuff.https.html" ) @@ -779,7 +874,8 @@ fn runner_url_path() { ); assert_eq!( - TestPath::from_fx_metadata_test( + TestPath::from_metadata_test( + Browser::Firefox, Path::new("testing/web-platform/mozilla/meta/blarg/stuff.https.html.ini"), "stuff.https.html?win" ) @@ -788,4 +884,16 @@ fn runner_url_path() { .to_string(), "_mozilla/blarg/stuff.https.html?win", ); + + assert_eq!( + TestPath::from_metadata_test( + Browser::Servo, + Path::new("tests/wpt/webgpu/meta/webgpu/cts.https.html.ini"), + "cts.https.html?win" + ) + .unwrap() + .runner_url_path() + .to_string(), + "_webgpu/webgpu/cts.https.html?win", + ); }