Skip to content
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

Add documentation on running fork tests #87

Merged
merged 2 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
WITHDRAWAL_DELAY=1
DEPLOYMENTS=MAINNET,TESTNET
MAINNET_BRIDGE_ADDRESS=0xBa5E35E26Ae59c7aea6F029B68c6460De2d13eB6
MAINNET_FLOW_RATED_TOKENS=0x0000000000000000000000000000000000000Eee,0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF,0xdAC17F958D2ee523a2206206994597C13D831ec7,0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599,0xccC8cb5229B0ac8069C51fd58367Fd1e622aFD97,0x9AB7bb7FdC60f4357ECFef43986818A2A3569c62
MAINNET_RPC_URL=
TESTNET_RPC_URL=
TESTNET_FLOW_RATED_TOKENS=0x0000000000000000000000000000000000000Eee,0xe2629e08f4125d14e446660028bd98ee60ee69f2
TESTNET_BRIDGE_ADDRESS=0x0D3C59c779Fd552C27b23F723E80246c840100F5
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,28 @@ $ forge install
$ forge build
```

### Test
### Testing
To run all tests (unit, integration, and fork tests), run the following command:
```shell
$ forge test
```
This requires setting the relevant environment variables as described in the "Fork Test" section below.

**Unit and Integration Tests Only**
```shell
$ forge test --no-match-path "test/fork/**"
```

**Fork Tests Only**

The fork tests run a suite of tests against one or more deployments of the bridge.
To run these tests copy [`.env.example`](.env.example) file to a `.env` file and set the `MAINNET_RPC_URL` and `TESTNET_RPC_URL` environment variables. Set or update any other environment variables as required.
Then run the following command to run the fork tests.

```shell
$ forge test --match-path "test/fork/**"
```

## Contract Deployment
### Local Deployment
To set up the contracts on two separate local networks, we need to start running the local networks, then deploy and initialize the contracts.
Expand Down
Loading