Skip to content

Commit

Permalink
fix: canary tests to use a fork (#2739)
Browse files Browse the repository at this point in the history
Fix #2698 
Fork was always working for `e2e-canary-test` but not for
`run-deployment-canary-uniswap` even though they use the same script and
similar docker-compose file.

BUT the `run_test.sh` script only created the fork variables if
`TEST_NAME = uniswap_trade_on_l1_from_l2.test.ts` - this is true for the
canary test but not the the deployment script where `TEST_NAME =
./src/uniswap_trade_on_l1_from_l2.test.ts`

No point in over-engineering to use the dumped state since
`run-deployment-canary-uniswap` only runs during releases
  • Loading branch information
rahul-kothari authored Oct 9, 2023
1 parent a7710f0 commit 4906142
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions yarn-project/canary/scripts/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ services:
ETHEREUM_HOST: http://fork:8545
CHAIN_ID: 31337
PXE_URL: http://sandbox:8080
SEARCH_START_BLOCK: ${FORK_BLOCK_NUMBER:-0}
command: ${TEST:-./src/uniswap_trade_on_l1_from_l2.test.ts}
5 changes: 3 additions & 2 deletions yarn-project/canary/scripts/run_tests
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ set -eu
export TEST=$1
export IMAGE=${2:-canary}
export COMPOSE_FILE=${3:-./scripts/docker-compose.yml}

if [ "$TEST" = "uniswap_trade_on_l1_from_l2.test.ts" ]; then
:
# if test name ends with uniswap_trade_on_l1_from_l2.test.ts, use the forked mainnet
if [[ "$TEST" == *"uniswap_trade_on_l1_from_l2.test.ts" ]]; then
export FORK_URL=https://mainnet.infura.io/v3/9928b52099854248b3a096be07a6b23c
export FORK_BLOCK_NUMBER=17514288
fi
Expand Down

0 comments on commit 4906142

Please sign in to comment.