Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: ignore_tests and include_tests config options #1346

Closed
transmissions11 opened this issue Apr 18, 2022 · 4 comments · Fixed by #1378
Closed

Feature request: ignore_tests and include_tests config options #1346

transmissions11 opened this issue Apr 18, 2022 · 4 comments · Fixed by #1378
Assignees
Labels
C-forge Command: forge Cmd-forge-test Command: forge test D-average Difficulty: average first issue A good way to start contributing P-normal Priority: normal T-feature Type: feature

Comments

@transmissions11
Copy link
Contributor

transmissions11 commented Apr 18, 2022

Component

Forge

Describe the feature you would like

The ability to set a specific set of tests to include/ignore in a config profile would be very helpful for my workflow, where i often have slow ffi tests that i only want to run every once in a while, and a set of fast unit tests that i want to run every time i type forge test

if this was implemented i could have an ffi profile that runs ffi tests along with my other tests, and ignore them in the default profile for daily use

Additional context

No response

@transmissions11 transmissions11 added the T-feature Type: feature label Apr 18, 2022
@transmissions11
Copy link
Contributor Author

i think these would basically just be config option equivalents of --no-match-test and --match-test

#[clap(long = "match-test", alias = "mt", conflicts_with = "pattern")]
pub test_pattern: Option<regex::Regex>,
/// Only run test functions that do not match the specified regex pattern.
#[clap(long = "no-match-test", alias = "nmt", conflicts_with = "pattern")]
pub test_pattern_inverse: Option<regex::Regex>,

@onbjerg
Copy link
Member

onbjerg commented Apr 18, 2022

Ref #1123 (not entirely the same, but similar use case)

@onbjerg onbjerg added first issue A good way to start contributing Cmd-forge-test Command: forge test C-forge Command: forge P-normal Priority: normal D-average Difficulty: average labels Apr 18, 2022
@onbjerg onbjerg added this to Foundry Apr 18, 2022
@onbjerg onbjerg moved this to Todo in Foundry Apr 18, 2022
@lattejed
Copy link
Contributor

I'll take a look at this 👋

@lattejed
Copy link
Contributor

So I've copied all of the matching flags from test to the Config file, swapping kebab for snake case, e.g., --match-test is match_test in foundry.toml.

Profiles work so you can store different matching setups in the config file and select them with FOUNDRY_PROFILE

If both config entry and flag are present, the flag takes precedence.

The full list:

match_test
no_match_test
match_contract
no_match_contract
match_path
no_match_path

@onbjerg onbjerg linked a pull request Apr 21, 2022 that will close this issue
@onbjerg onbjerg moved this from Todo to In Progress in Foundry Apr 21, 2022
Repository owner moved this from In Progress to Done in Foundry Apr 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge Cmd-forge-test Command: forge test D-average Difficulty: average first issue A good way to start contributing P-normal Priority: normal T-feature Type: feature
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants