-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(protocol/migrations_sol): adds existing unit tests
- Loading branch information
1 parent
f655dff
commit cd987f3
Showing
1 changed file
with
63 additions
and
1 deletion.
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 |
---|---|---|
@@ -1,4 +1,66 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
forge test --fork-url http://127.0.0.1:$ANVIL_PORT --match-contract=IntegrationTest -vvv # || echo "Test failed" # TODO for some reason the echo didn't work | ||
: ' | ||
The following runs specific integration tests. | ||
' | ||
# Run integration tests | ||
forge test \ | ||
--match-contract=IntegrationTest \ | ||
-vvv \ | ||
--fork-url http://127.0.0.1:$ANVIL_PORT | ||
|
||
: ' | ||
The following tests assert that existing unit tests pass when run against the migrated anvil fork. | ||
These are necessary, but not sufficient requirements. | ||
The idea is that existing unit tests, which are known to pass in a testing environment, should | ||
also pass if they are run against the devchain using the "--fork-url" flag. | ||
' | ||
# Run tests common | ||
# can't use gas limit because some setUp function use more than the limit | ||
forge test \ | ||
--match-path "test-sol/common/*" \ | ||
-vvv \ | ||
--fork-url http://127.0.0.1:$ANVIL_PORT | ||
|
||
# Run tests governance/network | ||
forge test \ | ||
--match-path "test-sol/governance/network/*" \ | ||
--block-gas-limit 50000000 \ | ||
-vvv \ | ||
--fork-url http://127.0.0.1:$ANVIL_PORT | ||
|
||
# Run tests governance/validators | ||
forge test \ | ||
--match-path "test-sol/governance/validators/*" \ | ||
--block-gas-limit 50000000 \ | ||
-vvv \ | ||
--fork-url http://127.0.0.1:$ANVIL_PORT | ||
|
||
# Run tests governance/voting | ||
# can't use gas limit because some setUp function use more than the limit | ||
forge test \ | ||
--match-path "test-sol/governance/voting/*" \ | ||
--block-gas-limit 50000000 \ | ||
-vvv \ | ||
--fork-url http://127.0.0.1:$ANVIL_PORT | ||
|
||
# Run tests stability | ||
forge test \ | ||
--match-path "test-sol/stability/*" \ | ||
--block-gas-limit 50000000 \ | ||
-vvv \ | ||
--fork-url http://127.0.0.1:$ANVIL_PORT | ||
|
||
# Run tests identity | ||
forge test \ | ||
--match-path "test-sol/identity/*" \ | ||
--block-gas-limit 50000000 \ | ||
-vvv \ | ||
--fork-url http://127.0.0.1:$ANVIL_PORT | ||
|
||
# Run Everything just in case something was missed | ||
# can't use gas limit because some setUp function use more than the limit | ||
forge test \ | ||
-vvv \ | ||
--fork-url http://127.0.0.1:$ANVIL_PORT #TODO this should ignore integration tests |