Skip to main content

Run Bridge Tests

This guide will show you how to run end-to-end (e2e) bridge tests against a Kurtosis devnet.

info

This guide assumes you have a running devnet, if that's not the case, you can head to the Getting Started section.

Clone the Test Suite

First, clone the agglayer/e2e repository. PoS-related tests are located in tests/pos.

git clone https://github.com/agglayer/e2e.git
cd e2e

Run Bats Tests

info

We rely on bats, a bash testing framework to run most of our e2e tests. The next steps assume you have it installed.

Then run the L1-to-L2 bridge test to validate that Heimdall and Bor can process bridge events and trigger state synchronizations.

bats --filter-tags pos,bridge --recursive tests/
tip

If you have deployed the test runner in your environment, you can run the tests without cloning the repository:

kurtosis service exec pos test-runner "bats --filter-tags pos,bridge --recursive tests/"

After the tests complete, you should see output similar to:

pos/bridge.bats
✓ bridge MATIC/POL from L1 to L2 and confirm L2 MATIC/POL balance increased
✓ bridge some ERC20 tokens from L1 to L2 and confirm L2 ERC20 balance increased
✓ bridge an ERC721 token from L1 to L2 and confirm L2 ERC721 balance increased
✓ bridge MATIC/POL, ERC20, and ERC721 from L1 to L2 and confirm L2 balances increased

4 tests, 0 failures

If any tests fail, check the logs in your Kurtosis enclave for more details.