Skip to content

Commit 06b2b35

Browse files
committed
Remove cleanup test macro parameter
1 parent 002b6e7 commit 06b2b35

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

test/test-manager/src/tests/test_metadata.rs

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ pub struct TestMetadata {
1010
pub priority: Option<i32>,
1111
pub always_run: bool,
1212
pub must_succeed: bool,
13-
pub cleanup: bool,
1413
}
1514

1615
impl TestMetadata {

test/test-manager/test_macro/src/lib.rs

+2-16
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ use test_rpc::meta::Os;
2323
/// * `priority` - The order in which tests will be run where low numbers run before high numbers
2424
/// and tests with the same number run in undefined order. `priority` defaults to 0.
2525
///
26-
/// * `cleanup` - If the cleanup function will run after the test is finished and among other things
27-
/// reset the settings to the default value for the daemon. `cleanup` defaults to true.
28-
///
2926
/// * `must_succeed` - If the testing suite stops running if this test fails. `must_succeed`
3027
/// defaults to false.
3128
///
@@ -54,11 +51,10 @@ use test_rpc::meta::Os;
5451
///
5552
/// ## Create a test with custom parameters
5653
///
57-
/// This test will run early in the test loop, won't perform any cleanup, must
58-
/// succeed and will always run.
54+
/// This test will run early in the test loop and must succeed and will always run.
5955
///
6056
/// ```ignore
61-
/// #[test_function(priority = -1337, cleanup = false, must_succeed = true, always_run = true)]
57+
/// #[test_function(priority = -1337, must_succeed = true, always_run = true)]
6258
/// pub async fn test_function(
6359
/// rpc: ServiceClient,
6460
/// mut mullvad_client: mullvad_management_interface::MullvadProxyClient,
@@ -112,7 +108,6 @@ fn parse_marked_test_function(
112108

113109
fn get_test_macro_parameters(attributes: &syn::AttributeArgs) -> Result<MacroParameters> {
114110
let mut priority = None;
115-
let mut cleanup = true;
116111
let mut always_run = false;
117112
let mut must_succeed = false;
118113
let mut targets = vec![];
@@ -139,11 +134,6 @@ fn get_test_macro_parameters(attributes: &syn::AttributeArgs) -> Result<MacroPar
139134
Lit::Bool(lit_bool) => must_succeed = lit_bool.value(),
140135
_ => bail!(nv, "'must_succeed' should have a bool value"),
141136
}
142-
} else if nv.path.is_ident("cleanup") {
143-
match lit {
144-
Lit::Bool(lit_bool) => cleanup = lit_bool.value(),
145-
_ => bail!(nv, "'cleanup' should have a bool value"),
146-
}
147137
} else if nv.path.is_ident("target_os") {
148138
let Lit::Str(lit_str) = lit else {
149139
bail!(nv, "'target_os' should have a string value");
@@ -166,7 +156,6 @@ fn get_test_macro_parameters(attributes: &syn::AttributeArgs) -> Result<MacroPar
166156

167157
Ok(MacroParameters {
168158
priority,
169-
cleanup,
170159
always_run,
171160
must_succeed,
172161
targets,
@@ -186,7 +175,6 @@ fn create_test(test_function: TestFunction) -> proc_macro2::TokenStream {
186175
})
187176
.collect();
188177

189-
let should_cleanup = test_function.macro_parameters.cleanup;
190178
let always_run = test_function.macro_parameters.always_run;
191179
let must_succeed = test_function.macro_parameters.must_succeed;
192180

@@ -232,7 +220,6 @@ fn create_test(test_function: TestFunction) -> proc_macro2::TokenStream {
232220
priority: #test_function_priority,
233221
always_run: #always_run,
234222
must_succeed: #must_succeed,
235-
cleanup: #should_cleanup,
236223
});
237224
}
238225
}
@@ -245,7 +232,6 @@ struct TestFunction {
245232

246233
struct MacroParameters {
247234
priority: Option<i32>,
248-
cleanup: bool,
249235
always_run: bool,
250236
must_succeed: bool,
251237
targets: Vec<Os>,

0 commit comments

Comments
 (0)