-
Notifications
You must be signed in to change notification settings - Fork 156
feat: add support for scenario testing #660
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
Merged
Merged
Conversation
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
Signed-off-by: Tomás Migone <[email protected]>
Signed-off-by: Tomás Migone <[email protected]>
Signed-off-by: Tomás Migone <[email protected]>
Signed-off-by: Tomás Migone <[email protected]>
Signed-off-by: Tomás Migone <[email protected]>
Signed-off-by: Tomás Migone <[email protected]>
Signed-off-by: Tomás Migone <[email protected]>
Signed-off-by: Tomás Migone <[email protected]>
Signed-off-by: Tomás Migone <[email protected]>
Signed-off-by: Tomás Migone <[email protected]>
Signed-off-by: Tomás Migone <[email protected]>
65c8aa2
to
1e4e888
Compare
Signed-off-by: Tomás Migone <[email protected]>
Codecov Report
@@ Coverage Diff @@
## dev #660 +/- ##
=======================================
Coverage 90.35% 90.35%
=======================================
Files 35 35
Lines 1762 1762
Branches 296 296
=======================================
Hits 1592 1592
Misses 170 170
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
Signed-off-by: Tomás Migone <[email protected]>
Signed-off-by: Tomás Migone <[email protected]>
abarmat
approved these changes
Jul 29, 2022
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.
Motivation
This PR adds support for e2e "scenario" testing. Scenarios are special tests that:
Scenarios are defined by an optional script and a test file:
e2e/scenarios/{scenario-name}.ts
.e2e/scenarios/{scenario-name}.test.ts
.Usage
The following command will run a scenario against the provided network:
Scenarios are also run as part of the e2e test suite, in this case scenarios are run one by one, meaning the script for a scenario is run followed by it's tests and only then the next scenario is run. This is to preserve the state between scenario runs as we don't know how the actions in one scenario can affect the next one.
Finally, the scenario scripts can also be ran independently from the tests as they are regular hardhat scripts:
Note that in all cases the protocol needs to be deployed and setup on the target network beforehand. Alternatively, you can run
yarn test:e2e
which will deploy a local network and run all e2e tests.Changes
e2e:scenario
hardhat task to run a specific scenarioe2e
hardhat task to run all scenarios as part of the test suite