summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorJoakim Hulthe <joakim@hulthe.net>2024-04-09 15:41:23 +0200
committerJoakim Hulthe <joakim@hulthe.net>2024-04-10 10:30:48 +0200
commit506389afbc0d4458e42a02a9e63035178eae45b9 (patch)
tree4a11702930a51ab74ce71f32dca25ab34f2a7e92 /test
parentfc2d3fb4d40b77f22d2b0bd240f2790f82e3eb2b (diff)
downloadmullvadvpn-506389afbc0d4458e42a02a9e63035178eae45b9.tar.xz
mullvadvpn-506389afbc0d4458e42a02a9e63035178eae45b9.zip
Sort desktop e2e result matrix by priority
Diffstat (limited to 'test')
-rw-r--r--test/test-manager/src/run_tests.rs10
-rw-r--r--test/test-manager/src/summary.rs2
-rw-r--r--test/test-manager/src/tests/mod.rs7
3 files changed, 12 insertions, 7 deletions
diff --git a/test/test-manager/src/run_tests.rs b/test/test-manager/src/run_tests.rs
index 38e5253fe8..0c7868e529 100644
--- a/test/test-manager/src/run_tests.rs
+++ b/test/test-manager/src/run_tests.rs
@@ -2,8 +2,7 @@ use crate::{
logging::{panic_as_string, TestOutput},
mullvad_daemon,
summary::{self, maybe_log_test_result},
- tests,
- tests::{config::TEST_CONFIG, TestContext},
+ tests::{self, config::TEST_CONFIG, get_tests, TestContext},
vm,
};
use anyhow::{Context, Result};
@@ -50,10 +49,9 @@ pub async fn run(
print_os_version(&client).await;
- let mut tests: Vec<_> = inventory::iter::<tests::TestMetadata>()
- .filter(|test| test.should_run_on_os(TEST_CONFIG.os))
- .collect();
- tests.sort_by_key(|test| test.priority.unwrap_or(0));
+ let mut tests = get_tests();
+
+ tests.retain(|test| test.should_run_on_os(TEST_CONFIG.os));
if !test_filters.is_empty() {
tests.retain(|test| {
diff --git a/test/test-manager/src/summary.rs b/test/test-manager/src/summary.rs
index c485ac6397..30b71948cf 100644
--- a/test/test-manager/src/summary.rs
+++ b/test/test-manager/src/summary.rs
@@ -199,7 +199,7 @@ impl Summary {
/// be parsed, we should not abort the entire summarization.
pub async fn print_summary_table<P: AsRef<Path>>(summary_files: &[P]) {
// Collect test details
- let tests: Vec<_> = inventory::iter::<crate::tests::TestMetadata>().collect();
+ let tests = crate::tests::get_tests();
let mut summaries = vec![];
let mut failed_to_parse = vec![];
diff --git a/test/test-manager/src/tests/mod.rs b/test/test-manager/src/tests/mod.rs
index 0ccbb9a0e7..32a32cb44a 100644
--- a/test/test-manager/src/tests/mod.rs
+++ b/test/test-manager/src/tests/mod.rs
@@ -64,6 +64,13 @@ pub enum Error {
Other(String),
}
+/// Get a list of all tests, sorted by priority.
+pub fn get_tests() -> Vec<&'static TestMetadata> {
+ let mut tests: Vec<_> = inventory::iter::<TestMetadata>().collect();
+ tests.sort_by_key(|test| test.priority.unwrap_or(0));
+ tests
+}
+
/// Restore settings to the defaults.
pub async fn cleanup_after_test(mullvad_client: &mut MullvadProxyClient) -> anyhow::Result<()> {
log::debug!("Cleaning up daemon in test cleanup");