-
Notifications
You must be signed in to change notification settings - Fork 375
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
test: forge test
should be all green and exclude tests that require anvil
#11148
test: forge test
should be all green and exclude tests that require anvil
#11148
Conversation
This allows us to exclude all tests in the `devchain/` directory when running `forge test`
Previously this was called Integration.t.sol, but that's not super obvious naming.
The configs of this profile extend or overwrite the default profile. That means we can customise the `match_path` and `no_match_path` configs in that profile and run `forge test` with that profile by passing an environment variable `FOUNDRY_PROFILE=devchain`. For example, once a devchain is serving at localhost: ```sh FOUNDRY_PROFILE=devchain forge test -vvv \ --match-path "test-sol/devchain/e2e/*" \ --fork-url $ANVIL_RPC_URL [⠒] Compiling... No files changed, compilation skipped Ran 1 test for test-sol/devchain/e2e/common/FeeCurrencyDirectory.t.sol:E2EDemo [PASS] test_ShouldAllowOwnerSetCurrencyConfig() (gas: 94493) Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 12.92ms (2.35ms CPU time) Ran 1 test suite in 164.71ms (12.92ms CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests) ```
This ensures that the correct profile is consumed on CI and the correct tests are run.
This ensures that the correct profile is consumed on CI and the correct tests are run.
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
Co-authored-by: Martín Volpe <[email protected]>
Description
foundry.toml
([profile.devchain]
) that defines custom configs when passing theFOUNDRY_PROFILE=devchain
env variable in Foundry commands (e.g.FOUNDRY_PROFILE=devchain forge test
)[profile.default]
) to exclude all files in**/test-sol/devchain/**
when runningforge test
Other changes
test-sol/devchain/
directory.e2e/
directory todevchain/
directory.Migration.t.sol
(formerlyIntegration.t.sol
), and moves it todevchain/migration
directory.Tested
Tested locally and on CI.
forge test
is all green ✅$ forge test
forge test
indevchain/
directory is all green ✅Related issues
forge test
should be all green and exclude e2e tests that require a devchain #11106Backwards compatibility
Brief explanation of why these changes are/are not backwards compatible.
Documentation
Yes, copy-pasted from
test-sol/devchain/README.md
: