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

test: Run canary tests using sandbox docker-compose.yml #2920

Closed
wants to merge 1 commit into from
Closed
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
7 changes: 6 additions & 1 deletion yarn-project/aztec-sandbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ From the `aztec-sandbox` directory, you can run the two existing examples:
- `yarn run:example:token`
- An L1 / L2 uniswap token trade.
- `yarn run:example:uniswap`
- To run this example, you need to use the `docker-compose-fork.yml` configuration.
- To run this example, you need to set the following vars:

```
export FORK_BLOCK_NUMBER=17514288
export FORK_URL=<YOUR_RPC_URL e.g. https://mainnet.infura.io/v3/API_KEY>
```

## Publishing

Expand Down
21 changes: 0 additions & 21 deletions yarn-project/aztec-sandbox/docker-compose-fork.yml

This file was deleted.

31 changes: 2 additions & 29 deletions yarn-project/canary/scripts/docker-compose-browser.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,9 @@
version: '3'
services:
fork:
image: ghcr.io/foundry-rs/foundry:nightly-a44aa13cfc23491ba32aaedc093e9488c1a6db43
entrypoint: >
sh -c '
if [ -n "$FORK_BLOCK_NUMBER" ] && [ -n "$FORK_URL" ]; then
exec anvil -p 8545 --host 0.0.0.0 --chain-id 31337 --fork-url "$FORK_URL" --fork-block-number "$FORK_BLOCK_NUMBER"
else
exec anvil -p 8545 --host 0.0.0.0 --chain-id 31337
fi'
ports:
- '8545:8545'

sandbox:
image: aztecprotocol/aztec-sandbox:canary
environment:
DEBUG: 'aztec:*'
ETHEREUM_HOST: http://fork:8545
CHAIN_ID: 31337
ARCHIVER_POLLING_INTERVAL_MS: 50
P2P_BLOCK_CHECK_INTERVAL_MS: 50
SEQ_TX_POLLING_INTERVAL_MS: 50
WS_BLOCK_CHECK_INTERVAL_MS: 50
PXE_BLOCK_POLLING_INTERVAL_MS: 50
ARCHIVER_VIEM_POLLING_INTERVAL_MS: 500
ports:
- '8080:8080'

canary:
image: aztecprotocol/canary:latest
environment:
ETHEREUM_HOST: http://fork:8545
ETHEREUM_HOST: http://ethereum:8545
CHAIN_ID: 31337
PXE_URL: http://sandbox:8080
PXE_URL: http://aztec:8080
command: ['./scripts/start_e2e_ci_browser.sh', './src/aztec_js_browser.test.ts']
36 changes: 0 additions & 36 deletions yarn-project/canary/scripts/docker-compose-e2e-sandbox.yml

This file was deleted.

33 changes: 3 additions & 30 deletions yarn-project/canary/scripts/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,9 @@
version: '3'
services:
fork:
image: ghcr.io/foundry-rs/foundry:nightly-a44aa13cfc23491ba32aaedc093e9488c1a6db43
entrypoint: >
sh -c '
if [ -n "$FORK_BLOCK_NUMBER" ] && [ -n "$FORK_URL" ]; then
exec anvil -p 8545 --host 0.0.0.0 --chain-id 31337 --fork-url "$FORK_URL" --fork-block-number "$FORK_BLOCK_NUMBER"
else
exec anvil -p 8545 --host 0.0.0.0 --chain-id 31337
fi'
ports:
- '8545:8545'

sandbox:
image: aztecprotocol/aztec-sandbox:canary
environment:
DEBUG: 'aztec:*'
ETHEREUM_HOST: http://fork:8545
CHAIN_ID: 31337
ARCHIVER_POLLING_INTERVAL_MS: 50
P2P_BLOCK_CHECK_INTERVAL_MS: 50
SEQ_TX_POLLING_INTERVAL_MS: 50
WS_BLOCK_CHECK_INTERVAL_MS: 50
PXE_BLOCK_POLLING_INTERVAL_MS: 50
ARCHIVER_VIEM_POLLING_INTERVAL_MS: 500
ports:
- '8080:8080'

canary:
image: aztecprotocol/canary:latest
environment:
ETHEREUM_HOST: http://fork:8545
ETHEREUM_HOST: http://ethereum:8545
CHAIN_ID: 31337
PXE_URL: http://sandbox:8080
command: ${TEST:-./src/uniswap_trade_on_l1_from_l2.test.ts}
PXE_URL: http://aztec:8080
command: ${TEST:-./src/cli.test.ts}
9 changes: 3 additions & 6 deletions yarn-project/canary/scripts/run_tests
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ IMAGE_URI=$(calculate_image_uri $IMAGE)
retry docker pull $IMAGE_URI
retry docker tag $IMAGE_URI aztecprotocol/canary:latest

SANDBOX_IMAGE_URI=$(calculate_image_uri aztec-sandbox)
retry docker pull $SANDBOX_IMAGE_URI
retry docker tag $SANDBOX_IMAGE_URI aztecprotocol/sandbox:latest

docker-compose -f $COMPOSE_FILE rm -f
docker-compose -f $COMPOSE_FILE up --exit-code-from canary
export SANDBOX_VERSION=canary
docker-compose -f ../../aztec-sandbox/docker-compose.yml -f $COMPOSE_FILE rm -f
docker-compose -f ../../aztec-sandbox/docker-compose.yml -f $COMPOSE_FILE up --exit-code-from canary