diff --git a/.config/nextest.toml b/.config/nextest.toml index 02920ab7aa105..a28292b5c4f5f 100644 --- a/.config/nextest.toml +++ b/.config/nextest.toml @@ -1,4 +1,5 @@ -# TODO: Figure out why this specific test is flaky on CI, fix it, then delete this file. +# This is needed so we don't try to run too many visual tests at the same time, +# as they tend to crash on GitHub Actions runners - maybe due to not enough memory. [[profile.ci.overrides]] -filter = "test(avm2/pixelbender_shaderdata)" -retries = 3 +filter = "test(/^\\[render\\] /)" +threads-required = 3 diff --git a/tests/framework/src/options.rs b/tests/framework/src/options.rs index 068abaf38825b..e0d0ab90f0905 100644 --- a/tests/framework/src/options.rs +++ b/tests/framework/src/options.rs @@ -218,6 +218,10 @@ impl PlayerOptions { }) } + pub fn needs_renderer(&self) -> bool { + self.with_renderer.is_some() + } + pub fn create_renderer( &self, environment: &impl Environment, diff --git a/tests/framework/src/test.rs b/tests/framework/src/test.rs index c35ce71dec328..ff336695ffd43 100644 --- a/tests/framework/src/test.rs +++ b/tests/framework/src/test.rs @@ -15,6 +15,26 @@ pub struct Font { pub italic: bool, } +#[derive(Clone, Copy)] +pub enum TestKind { + Render, +} + +impl TestKind { + pub fn name(self) -> &'static str { + match self { + TestKind::Render => "render", + } + } + + pub fn ord(kind: &str) -> impl Ord { + match kind { + "render" => 0, + _ => 1, + } + } +} + pub struct Test { pub options: TestOptions, pub swf_path: VfsPath, @@ -43,6 +63,14 @@ impl Test { }) } + pub fn kind(&self) -> Option { + if self.options.player_options.needs_renderer() { + Some(TestKind::Render) + } else { + None + } + } + pub fn create_test_runner(&self, environment: &impl Environment) -> Result { let movie = self.movie()?; let viewport_dimensions = self.options.player_options.viewport_dimensions(&movie); diff --git a/tests/tests/regression_tests.rs b/tests/tests/regression_tests.rs index 3eb4881fe6165..07dc9830e789e 100644 --- a/tests/tests/regression_tests.rs +++ b/tests/tests/regression_tests.rs @@ -166,6 +166,7 @@ fn run_test(args: &Arguments, file: &Path, name: &str) -> Trial { .unwrap(); let ignore = !test.should_run(!args.list, &NativeEnvironment); + let kind = test.kind(); let mut trial = Trial::test(test.name.to_string(), move || { let test = AssertUnwindSafe(test); @@ -197,6 +198,9 @@ fn run_test(args: &Arguments, file: &Path, name: &str) -> Trial { } } }); + if let Some(kind) = kind { + trial = trial.with_kind(kind.name()); + } if ignore { trial = trial.with_ignored_flag(true); }