-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(
cheatcodes
): properly filter cheatcode tests (#5744)
* chore: use proper filter * chore: fix tests * chore: remove cruft * fmt * clippy * chore: use simpler error * drop clunky cross-platform comparison
- Loading branch information
Showing
9 changed files
with
36 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
//! forge tests for cheat codes | ||
|
||
use foundry_config::{fs_permissions::PathPermission, Config, FsPermissions}; | ||
|
||
use crate::{ | ||
config::*, | ||
test_helpers::{filter::Filter, RE_PATH_SEPARATOR}, | ||
test_helpers::{filter::Filter, PROJECT, RE_PATH_SEPARATOR}, | ||
}; | ||
|
||
/// Executes all cheat code tests but not fork cheat codes | ||
#[tokio::test(flavor = "multi_thread")] | ||
async fn test_cheats_local() { | ||
let mut config = Config::with_root(PROJECT.root()); | ||
config.fs_permissions = FsPermissions::new(vec![PathPermission::read_write("./")]); | ||
let runner = runner_with_config(config); | ||
let filter = | ||
Filter::new(".*", "Skip*", &format!(".*cheats{RE_PATH_SEPARATOR}*")).exclude_paths("Fork"); | ||
Filter::new(".*", ".*", &format!(".*cheats{RE_PATH_SEPARATOR}*")).exclude_paths("Fork"); | ||
|
||
// on windows exclude ffi tests since no echo and file test that expect a certain file path | ||
#[cfg(windows)] | ||
let filter = filter.exclude_tests("(Ffi|File|Line|Root)"); | ||
|
||
TestConfig::filter(filter).await.run().await; | ||
TestConfig::with_filter(runner.await, filter).run().await; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters