-
Notifications
You must be signed in to change notification settings - Fork 699
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bridge zombienet tests: remove old command (#5434)
Related to: #3176 This PR: - migrates test 0003 to the new bridges zombienet tests command **This test didn't work before and it still doesn't work. It was added at a time when we couldn't run it because we didn't have the scafolding. It needs to be fixed. For the moment we keep it in the repo as it is since the idea has value. But we don't run it in the CI. We can also decide to remove it in the future** - removes the old command for running bridge zombienet tests - updates the README
- Loading branch information
Showing
9 changed files
with
70 additions
and
207 deletions.
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
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,31 +1,29 @@ | ||
# Bridges Tests for Local Rococo <> Westend Bridge | ||
|
||
This folder contains [zombienet](https://github.com/paritytech/zombienet/) based integration tests for both | ||
onchain and offchain bridges code. Due to some | ||
[technical difficulties](https://github.com/paritytech/parity-bridges-common/pull/2649#issue-1965339051), we | ||
are using native zombienet provider, which means that you need to build some binaries locally. | ||
onchain and offchain bridges code. | ||
|
||
To start those tests, you need to: | ||
Prerequisites for running the tests locally: | ||
|
||
- download latest [zombienet release](https://github.com/paritytech/zombienet/releases); | ||
|
||
- build Polkadot binary by running `cargo build -p polkadot --release --features fast-runtime` command in the | ||
[`polkadot-sdk`](https://github.com/paritytech/polkadot-sdk) repository clone; | ||
[`polkadot-sdk`](https://github.com/paritytech/polkadot-sdk) repository clone; | ||
|
||
- build Polkadot Parachain binary by running `cargo build -p polkadot-parachain-bin --release` command in the | ||
[`polkadot-sdk`](https://github.com/paritytech/polkadot-sdk) repository clone; | ||
[`polkadot-sdk`](https://github.com/paritytech/polkadot-sdk) repository clone; | ||
|
||
- ensure that you have [`node`](https://nodejs.org/en) installed. Additionally, we'll need globally installed | ||
`polkadot/api-cli` package (use `npm install -g @polkadot/api-cli@beta` to install it); | ||
`polkadot/api-cli` package (use `npm install -g @polkadot/api-cli@beta` to install it); | ||
|
||
- build Substrate relay by running `cargo build -p substrate-relay --release` command in the | ||
[`parity-bridges-common`](https://github.com/paritytech/parity-bridges-common) repository clone. | ||
[`parity-bridges-common`](https://github.com/paritytech/parity-bridges-common) repository clone; | ||
|
||
- copy fresh `substrate-relay` binary, built in previous point, to the `~/local_bridge_testing/bin/substrate-relay`; | ||
- copy the `substrate-relay` binary, built in the previous step, to `~/local_bridge_testing/bin/substrate-relay`; | ||
|
||
- change the `POLKADOT_SDK_PATH` and `ZOMBIENET_BINARY_PATH` (and ensure that the nearby variables | ||
have correct values) in the `./run-tests.sh`. | ||
After that, any test can be run using the `run-test.sh` command. | ||
Example: `./run-new-test.sh 0001-asset-transfer` | ||
|
||
After that, you could run tests with the `./run-tests.sh` command. Hopefully, it'll show the | ||
Hopefully, it'll show the | ||
"All tests have completed successfully" message in the end. Otherwise, it'll print paths to zombienet | ||
process logs, which, in turn, may be used to track locations of all spinned relay and parachain nodes. |
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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
bridges/testing/tests/0003-required-headers-synced-while-active-rococo-to-westend.zndsl
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
bridges/testing/tests/0003-required-headers-synced-while-active-westend-to-rococo.zndsl
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
bridges/testing/tests/0003-required-headers-synced-while-active/rococo-to-westend.zndsl
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Description: While relayer is active, we only sync mandatory and required Rococo (and Rococo BH) headers to Westend BH. | ||
Network: {{ENV_PATH}}/bridge_hub_westend_local_network.toml | ||
Creds: config | ||
|
||
# ensure that relayer won't sync any extra headers while delivering messages and confirmations | ||
bridge-hub-westend-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/only-required-headers-synced-when-active.js with "500,rococo-at-westend" within 600 seconds | ||
|
44 changes: 44 additions & 0 deletions
44
bridges/testing/tests/0003-required-headers-synced-while-active/run.sh
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# TODO: This test doesn't work. It was added at a time when we couldn't run it because we didn't have the scafolding. | ||
# It needs to be fixed. For the moment we keep it in the repo as it is since the idea has value. | ||
# But we don't run it in the CI. | ||
|
||
source "${BASH_SOURCE%/*}/../../framework/utils/common.sh" | ||
source "${BASH_SOURCE%/*}/../../framework/utils/zombienet.sh" | ||
|
||
export ENV_PATH=`realpath ${BASH_SOURCE%/*}/../../environments/rococo-westend` | ||
|
||
logs_dir=$TEST_DIR/logs | ||
|
||
$ENV_PATH/spawn.sh --init & | ||
env_pid=$! | ||
|
||
ensure_process_file $env_pid $TEST_DIR/rococo.env 600 | ||
rococo_dir=`cat $TEST_DIR/rococo.env` | ||
echo | ||
|
||
ensure_process_file $env_pid $TEST_DIR/westend.env 300 | ||
westend_dir=`cat $TEST_DIR/westend.env` | ||
echo | ||
|
||
echo "Sending message from Rococo to Westend" | ||
$ENV_PATH/helper.sh auto-log reserve-transfer-assets-from-asset-hub-rococo-local 5000000000000 | ||
echo | ||
|
||
echo "Sending message from Westend to Rococo" | ||
$ENV_PATH/helper.sh auto-log reserve-transfer-assets-from-asset-hub-westend-local 5000000000000 | ||
echo | ||
|
||
|
||
# Start the relayer with a 30s delay | ||
# We want to be sure that the messages won't be relayed before starting the js script in `rococo-to-westend.zndsl` | ||
start_relayer_log=$logs_dir/start_relayer.log | ||
echo -e "The rococo-westend relayer will be started in 30s. Logs will be available at: $start_relayer_log\n" | ||
(sleep 30 && $ENV_PATH/start_relayer.sh \ | ||
$rococo_dir $westend_dir finality_relayer_pid parachains_relayer_pid messages_relayer_pid > $start_relayer_log)& | ||
|
||
run_zndsl ${BASH_SOURCE%/*}/rococo-to-westend.zndsl $westend_dir | ||
|