diff options
| author | Sebastian Holmin <sebastian.holmin@mullvad.net> | 2024-11-15 17:12:04 +0100 |
|---|---|---|
| committer | Sebastian Holmin <sebastian.holmin@mullvad.net> | 2024-11-20 08:39:30 +0100 |
| commit | 28719d1c3d80deb66e79b8588dbcd2a5831692a4 (patch) | |
| tree | 59215c98079da47c691411d93d5f450e55e49532 /test | |
| parent | 056d8b98e4afaec21d62acbf32b4132e0d869130 (diff) | |
| download | mullvadvpn-28719d1c3d80deb66e79b8588dbcd2a5831692a4.tar.xz mullvadvpn-28719d1c3d80deb66e79b8588dbcd2a5831692a4.zip | |
Do not fail when specifying tests skipped for OS
When starting e2e tests on multiple platforms, we always specify
the same list of tests for all paltforms. Therefore we should not
fail on parsing a test that is skipped for the current platform.
Diffstat (limited to 'test')
| -rw-r--r-- | test/test-manager/src/tests/mod.rs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/test/test-manager/src/tests/mod.rs b/test/test-manager/src/tests/mod.rs index ca24cd63bf..0c595320f3 100644 --- a/test/test-manager/src/tests/mod.rs +++ b/test/test-manager/src/tests/mod.rs @@ -83,9 +83,12 @@ pub fn get_tests() -> Vec<&'static TestMetadata> { } pub fn get_filtered_tests(specified_tests: &[String]) -> Result<Vec<&TestMetadata>, anyhow::Error> { - let mut tests = get_tests(); - tests.retain(|test| test.should_run_on_os(TEST_CONFIG.os)); - if !specified_tests.is_empty() { + let tests = get_tests(); + + let mut tests = if specified_tests.is_empty() { + // Keep all tests + tests + } else { specified_tests .iter() .map(|f| { @@ -95,11 +98,10 @@ pub fn get_filtered_tests(specified_tests: &[String]) -> Result<Vec<&TestMetadat .cloned() .ok_or(anyhow::anyhow!("Test '{f}' not found")) }) - .collect() - } else { - // Keep all tests - Ok(tests) - } + .collect::<Result<_, anyhow::Error>>()? + }; + tests.retain(|test| test.should_run_on_os(TEST_CONFIG.os)); + Ok(tests) } /// Make sure the daemon is installed and logged in and restore settings to the defaults. |
