diff options
| author | Sebastian Holmin <sebastian.holmin@mullvad.net> | 2024-08-05 13:49:16 +0200 |
|---|---|---|
| committer | Sebastian Holmin <sebastian.holmin@mullvad.net> | 2024-08-16 11:19:07 +0200 |
| commit | 2aa120d8944ddc4575da6d73b9e36766849c1ba0 (patch) | |
| tree | 6a2fb5e1d49089d496c2bd5cb3e6f2507b241d78 | |
| parent | 5f9d41613b0938e3ba779d01682651ff06d123af (diff) | |
| download | mullvadvpn-2aa120d8944ddc4575da6d73b9e36766849c1ba0.tar.xz mullvadvpn-2aa120d8944ddc4575da6d73b9e36766849c1ba0.zip | |
Remove `must_succede` test macro parameter
This simplifes handling of test results.
| -rw-r--r-- | test/test-manager/src/summary.rs | 6 | ||||
| -rw-r--r-- | test/test-manager/src/tests/test_metadata.rs | 1 | ||||
| -rw-r--r-- | test/test-manager/test_macro/src/lib.rs | 17 |
3 files changed, 3 insertions, 21 deletions
diff --git a/test/test-manager/src/summary.rs b/test/test-manager/src/summary.rs index ab217642d3..1beaef91b9 100644 --- a/test/test-manager/src/summary.rs +++ b/test/test-manager/src/summary.rs @@ -250,11 +250,7 @@ pub async fn print_summary_table<P: AsRef<Path>>(summary_files: &[P]) { for test in &tests { println!("<tr>"); - println!( - "<td>{}{}</td>", - test.name, - if test.must_succeed { " *" } else { "" } - ); + println!("<td>{}</td>", test.name,); let mut failed_platforms = vec![]; for summary in &summaries { diff --git a/test/test-manager/src/tests/test_metadata.rs b/test/test-manager/src/tests/test_metadata.rs index c403795a2b..d3d7a40407 100644 --- a/test/test-manager/src/tests/test_metadata.rs +++ b/test/test-manager/src/tests/test_metadata.rs @@ -9,7 +9,6 @@ pub struct TestMetadata { pub func: TestWrapperFunction, pub priority: Option<i32>, pub always_run: bool, - pub must_succeed: bool, } impl TestMetadata { diff --git a/test/test-manager/test_macro/src/lib.rs b/test/test-manager/test_macro/src/lib.rs index fc9a077ddb..5a14a51c6b 100644 --- a/test/test-manager/test_macro/src/lib.rs +++ b/test/test-manager/test_macro/src/lib.rs @@ -23,9 +23,6 @@ use test_rpc::meta::Os; /// * `priority` - The order in which tests will be run where low numbers run before high numbers /// and tests with the same number run in undefined order. `priority` defaults to 0. /// -/// * `must_succeed` - If the testing suite stops running if this test fails. `must_succeed` -/// defaults to false. -/// /// * `always_run` - If the test should always run regardless of what test filters are provided by /// the user. `always_run` defaults to false. /// @@ -51,10 +48,10 @@ use test_rpc::meta::Os; /// /// ## Create a test with custom parameters /// -/// This test will run early in the test loop and must succeed and will always run. +/// This test will run early in the test loop and will always run. /// /// ```ignore -/// #[test_function(priority = -1337, must_succeed = true, always_run = true)] +/// #[test_function(priority = -1337, always_run = true)] /// pub async fn test_function( /// rpc: ServiceClient, /// mut mullvad_client: mullvad_management_interface::MullvadProxyClient, @@ -109,7 +106,6 @@ fn parse_marked_test_function( fn get_test_macro_parameters(attributes: &syn::AttributeArgs) -> Result<MacroParameters> { let mut priority = None; let mut always_run = false; - let mut must_succeed = false; let mut targets = vec![]; for attribute in attributes { @@ -129,11 +125,6 @@ fn get_test_macro_parameters(attributes: &syn::AttributeArgs) -> Result<MacroPar Lit::Bool(lit_bool) => always_run = lit_bool.value(), _ => bail!(nv, "'always_run' should have a bool value"), } - } else if nv.path.is_ident("must_succeed") { - match lit { - Lit::Bool(lit_bool) => must_succeed = lit_bool.value(), - _ => bail!(nv, "'must_succeed' should have a bool value"), - } } else if nv.path.is_ident("target_os") { let Lit::Str(lit_str) = lit else { bail!(nv, "'target_os' should have a string value"); @@ -157,7 +148,6 @@ fn get_test_macro_parameters(attributes: &syn::AttributeArgs) -> Result<MacroPar Ok(MacroParameters { priority, always_run, - must_succeed, targets, }) } @@ -176,7 +166,6 @@ fn create_test(test_function: TestFunction) -> proc_macro2::TokenStream { .collect(); let always_run = test_function.macro_parameters.always_run; - let must_succeed = test_function.macro_parameters.must_succeed; let func_name = test_function.name; let function_mullvad_version = test_function.function_parameters.mullvad_client.version(); @@ -219,7 +208,6 @@ fn create_test(test_function: TestFunction) -> proc_macro2::TokenStream { func: #wrapper_closure, priority: #test_function_priority, always_run: #always_run, - must_succeed: #must_succeed, }); } } @@ -233,7 +221,6 @@ struct TestFunction { struct MacroParameters { priority: Option<i32>, always_run: bool, - must_succeed: bool, targets: Vec<Os>, } |
