Repository navigation
test: skip the Zap4 and constituent-audit fork suites when not on a fork - #2
Open
hey-research-lab wants to merge 1 commit into
Open
hey-research-lab wants to merge 1 commit into
hey-research-lab wants to merge 1 commit into
Conversation
VimenZap4Fork, VimenZap4RialtoFork and NewConstituentAuditFork build against mainnet contracts in setUp but, unlike the other fork suites, do not skip when no fork is active, so a plain forge test fails with three errors (NotAContract in two setUps, a revert in the audit).
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
contracts/README.mddocumentsforge testas the local test command and says the fork suites self-skip when no fork is configured. Onmain(e36785c) a plainforge testincontracts/fails:These three suites are meant to run with
--fork-url $RH_RPC(as their headers say) and construct aBasketTokenover mainnet tokens or read mainnet pools insetUp. Without a fork those addresses have no code, sosetUpreverts — unlikeFork.t.sol,VimenZap*.fork.t.solandTwapOracle.fork.t.sol, which skip. (VimenZap4RialtoForkalready has anonlyForkchain-id check on its tests, but itssetUpfails before that check is reached.)Fix
First line of each of the three
setUps:vm.skip(block.chainid != 4663);. Off a fork the suites are reported as skipped; with--fork-urlon Robinhood Chain they run exactly as before. Test-only change.Validation
forge build && forge test(Foundry 1.5.1, no RPC): before 214 passed / 3 failed / 25 skipped; after 214 passed / 0 failed / 28 skipped.forge test --match-contract "VimenZap4Fork|NewConstituentAuditFork" --fork-url https://rpc.mainnet.chain.robinhood.com: 5 passed (4 + 1), same as without the change.forge test --match-contract VimenZap4RialtoFork --fork-url https://rpc.mainnet.chain.robinhood.com: 2 passed, same as without the change.