-
Notifications
You must be signed in to change notification settings - Fork 239
Description
Which components does the task require to be changed? (think hard pls)
snforge
Description
Currently when no --ignored
or --include-ignored
flag is passed we let tests marked with #[ignore]
pass the filtering here
starknet-foundry/crates/forge/src/test_filter.rs
Lines 105 to 109 in f92814d
cases = match self.ignored_filter { | |
// if NotIgnored (default) we filter ignored tests later and display them as ignored | |
IgnoredFilter::All | IgnoredFilter::NotIgnored => cases, | |
IgnoredFilter::Ignored => cases.into_iter().filter(|tc| tc.ignored).collect(), | |
}; |
starknet-foundry/crates/forge/src/lib.rs
Lines 104 to 107 in f92814d
let test_crates = test_crates | |
.into_iter() | |
.map(|tc| tests_filter.filter_tests(tc)) | |
.collect::<Result<Vec<CompiledTestCrateRaw>>>()?; |
to later print tests as ignored (matches cargo behaviour).
This makes us collect block numbers and check rpc version for tests that won't be executed (in case they are fork tests)
starknet-foundry/crates/forge/src/lib.rs
Lines 126 to 127 in f92814d
let compiled_test_crate = | |
to_runnable(compiled_test_crate, fork_targets, block_number_map).await?; |
Additionally,
starknet-foundry/crates/forge/src/test_filter.rs
Lines 118 to 126 in f92814d
impl TestCaseFilter for TestsFilter { | |
fn should_be_run(&self, test_case: &TestCaseRunnable) -> bool { | |
match self.ignored_filter { | |
IgnoredFilter::All => true, | |
IgnoredFilter::Ignored => test_case.ignored, | |
IgnoredFilter::NotIgnored => !test_case.ignored, | |
} | |
} | |
} |
impl TestCaseFilter for TestsFilter {
fn should_be_run(&self, test_case: &TestCaseRunnable) -> bool {
match self.ignored_filter {
IgnoredFilter::All => true,
IgnoredFilter::Ignored => {
assert!(test_case.ignored); // we filter all not ignored test before
true
}
IgnoredFilter::NotIgnored => !test_case.ignored,
}
}
}
Metadata
Metadata
Assignees
Labels
Type
Projects
Status