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

Expand forge test --match interface #388

Merged
merged 10 commits into from
Jan 6, 2022
Merged

Conversation

lattejed
Copy link
Contributor

@lattejed lattejed commented Jan 6, 2022

From issue: #227

This PR deprecates forge test --match and expands the match interface to

--match-test
--no-match-test
--match-contract
--no-match-contract

to allow for more granular test matching.

Internally, test runners have Regex replaced with trait/impl TestFilter to allow for custom matching logic in client code.

Conflicts have been added between --match and the new options to prevent mix/match of these. However, --match is effectively aliased to --match-test so there are no breaking changes.

Affected tests have been updated.

Any / all input welcome.

Copy link
Member

@gakonst gakonst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really great work - clean.

@gakonst gakonst merged commit f3a49ee into foundry-rs:master Jan 6, 2022
@lattejed
Copy link
Contributor Author

lattejed commented Jan 6, 2022

Thanks @gakonst, appreciate it

@jo-es
Copy link

jo-es commented Feb 2, 2022

I'm in the process of migrating a larger dapptools project to foundry. We have separate contracts for rpc based tests and local tests grouped by directory. --match from dapptools allows for specifying paths / sub directories to tests which works well in our case.

The only way to do this with forge atm would be to have an external script which generates a custom regex string and supply that to --match-contract.

To streamline this I would either extend --match-contract to account for the path to the contract file or add a new --match-dir / --match-file flag.

@gakonst
Copy link
Member

gakonst commented Feb 2, 2022

@lattejed see above, nice idea

@lattejed
Copy link
Contributor Author

lattejed commented Feb 2, 2022

I'll take a look at it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-feature Type: feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants