Skip to content

Commit 538e6bb

Browse files
committed
Sort desktop e2e result matrix by priority
1 parent 9a23de0 commit 538e6bb

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

Diff for: test/test-manager/src/run_tests.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ use crate::{
22
logging::{panic_as_string, TestOutput},
33
mullvad_daemon,
44
summary::{self, maybe_log_test_result},
5-
tests,
6-
tests::{config::TEST_CONFIG, TestContext},
5+
tests::{self, config::TEST_CONFIG, get_tests, TestContext},
76
vm,
87
};
98
use anyhow::{Context, Result};
@@ -50,10 +49,9 @@ pub async fn run(
5049

5150
print_os_version(&client).await;
5251

53-
let mut tests: Vec<_> = inventory::iter::<tests::TestMetadata>()
54-
.filter(|test| test.should_run_on_os(TEST_CONFIG.os))
55-
.collect();
56-
tests.sort_by_key(|test| test.priority.unwrap_or(0));
52+
let mut tests = get_tests();
53+
54+
tests.retain(|test| test.should_run_on_os(TEST_CONFIG.os));
5755

5856
if !test_filters.is_empty() {
5957
tests.retain(|test| {

Diff for: test/test-manager/src/summary.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ impl Summary {
199199
/// be parsed, we should not abort the entire summarization.
200200
pub async fn print_summary_table<P: AsRef<Path>>(summary_files: &[P]) {
201201
// Collect test details
202-
let tests: Vec<_> = inventory::iter::<crate::tests::TestMetadata>().collect();
202+
let tests = crate::tests::get_tests();
203203

204204
let mut summaries = vec![];
205205
let mut failed_to_parse = vec![];

Diff for: test/test-manager/src/tests/mod.rs

+7
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ pub enum Error {
6464
Other(String),
6565
}
6666

67+
/// Get a list of all tests, sorted by priority.
68+
pub fn get_tests() -> Vec<&'static TestMetadata> {
69+
let mut tests: Vec<_> = inventory::iter::<TestMetadata>().collect();
70+
tests.sort_by_key(|test| test.priority.unwrap_or(0));
71+
tests
72+
}
73+
6774
/// Restore settings to the defaults.
6875
pub async fn cleanup_after_test(mullvad_client: &mut MullvadProxyClient) -> anyhow::Result<()> {
6976
log::debug!("Cleaning up daemon in test cleanup");

0 commit comments

Comments
 (0)