-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Description Another branch PR on THE BIG ONE. This is a long-overdue cleanup and improvement of our fork tests structure. These tests are important and we will want to maintain and grow them, but the structure they were in made this very hard. They were also terribly brittle and fleaky. The [new structure](https://github.com/mento-protocol/mento-core/blob/81bd18666ea088d6df1cfa461d5f902e36a2c49a/test/fork/README.md) I'm proposing aims to tackle two main issues: - Fork tests were executing assertions for all exchanges in a single test making it hard to debug and follow. - Helpers and utility functions weren't structured and were hard to debug and maintain. Note for reviewers: 99% of the code inside of the functions is just copied from the old structure so I wouldn't do a full review of everything, I would focus on the structure itself. I did make some small tweaks to improve flakiness, for example skipping some of the tests when the limits prevent them, which I think is a fair thing to do, as long as the tests run periodically. ### Other changes I added a CI job for running fork-tests daily on `develop`. ### Tested Yeah, they are, after all, tests. ### Related issues N/A ### Backwards compatibility N/A ### Documentation N/A --------- Co-authored-by: Bayological <6872903+bayological@users.noreply.github.com> Co-authored-by: chapati <philip.paetz@me.com> Co-authored-by: philbow61 <80156619+philbow61@users.noreply.github.com> Co-authored-by: baroooo <baranseltekin@gmail.com>
- Loading branch information
1 parent
d916e50
commit 24a2e68
Showing
23 changed files
with
1,828 additions
and
1,386 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: "ForkTests" | ||
|
||
env: | ||
FOUNDRY_PROFILE: "fork-tests" | ||
ALFAJORES_RPC_URL: ${{secrets.ALFAJORES_RPC_URL}} | ||
CELO_MAINNET_RPC_URL: ${{secrets.CELO_MAINNET_RPC_URL}} | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 0 * * *" # everyday at midnight | ||
|
||
jobs: | ||
test: | ||
name: Run fork tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: "recursive" | ||
ref: develop | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: "Install Node.js" | ||
uses: "actions/setup-node@v3" | ||
with: | ||
cache: "yarn" | ||
node-version: "20" | ||
|
||
- name: "Install the Node.js dependencies" | ||
run: "yarn install --immutable" | ||
|
||
- name: "Show the Foundry config" | ||
run: "forge config" | ||
|
||
- name: "Run the tests" | ||
run: "forge test" | ||
|
||
- name: "Add test summary" | ||
run: | | ||
echo "## Tests" >> $GITHUB_STEP_SUMMARY |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.