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

Bridge zombienet tests - move all test scripts to the same folder #3333

Merged
merged 7 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Rename bridges/zombienet -> bridges/testing
  • Loading branch information
serban300 committed Feb 15, 2024
commit 8e3d09477b67cbc05ef7092944c145d595216fb5
1 change: 1 addition & 0 deletions .config/taplo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ exclude = [
"polkadot/node/malus/integrationtests/**",
"polkadot/zombienet_tests/**",
"substrate/zombienet/**",
"bridges/testing/**"
]

# global rules
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/pipeline/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -409,4 +409,4 @@ prepare-bridges-zombienet-artifacts:
before_script:
- mkdir -p ./artifacts/bridges-polkadot-sdk/bridges
script:
- cp -r bridges/zombienet ./artifacts/bridges-polkadot-sdk/bridges/zombienet
- cp -r bridges/testing ./artifacts/bridges-polkadot-sdk/bridges/testing
8 changes: 4 additions & 4 deletions .gitlab/pipeline/zombienet/bridges.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
variables:
BRIDGES_ZOMBIENET_TESTS_IMAGE_TAG: ${DOCKER_IMAGES_VERSION}
BRIDGES_ZOMBIENET_TESTS_IMAGE: "docker.io/paritypr/bridges-zombienet-tests"
GH_DIR: "https://github.com/paritytech/polkadot-sdk/tree/${CI_COMMIT_SHA}/bridges/zombienet"
LOCAL_DIR: "/builds/parity/mirrors/polkadot-sdk/bridges/zombienet"
GH_DIR: "https://github.com/paritytech/polkadot-sdk/tree/${CI_COMMIT_SHA}/bridges/testing"
LOCAL_DIR: "/builds/parity/mirrors/polkadot-sdk/bridges/testing"
FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: 1
RUN_IN_CONTAINER: "1"
artifacts:
Expand All @@ -51,12 +51,12 @@ zombienet-bridges-0001-asset-transfer-works:
extends:
- .zombienet-bridges-common
script:
- /home/nonroot/bridges-polkadot-sdk/bridges/zombienet/run-new-test.sh 0001-asset-transfer --docker
- /home/nonroot/bridges-polkadot-sdk/bridges/testing/run-new-test.sh 0001-asset-transfer --docker
- echo "Done"

zombienet-bridges-0002-mandatory-headers-synced-while-idle:
extends:
- .zombienet-bridges-common
script:
- /home/nonroot/bridges-polkadot-sdk/bridges/zombienet/run-new-test.sh 0002-mandatory-headers-synced-while-idle --docker
- /home/nonroot/bridges-polkadot-sdk/bridges/testing/run-new-test.sh 0002-mandatory-headers-synced-while-idle --docker
- echo "Done"
File renamed without changes.
3 changes: 3 additions & 0 deletions bridges/testing/environments/rococo-westend/helper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

$POLKADOT_SDK_PATH/bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh "$@"
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ done
# assuming that we'll be using native provide && all processes will be executing locally
# (we need absolute paths here, because they're used when scripts are called by zombienet from tmp folders)
export POLKADOT_SDK_PATH=`realpath $(dirname "$0")/../..`
export BRIDGE_TESTS_FOLDER=$POLKADOT_SDK_PATH/bridges/zombienet/tests
export BRIDGE_TESTS_FOLDER=$POLKADOT_SDK_PATH/bridges/testing/tests

# set pathc to binaries
if [ "$ZOMBIENET_DOCKER_PATHS" -eq 1 ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

INVOKE_LOG=`mktemp -p $TEST_FOLDER invoke.XXXXX`

pushd $POLKADOT_SDK_PATH/bridges/zombienet/environments/rococo-westend
pushd $POLKADOT_SDK_PATH/bridges/testing/environments/rococo-westend
./bridges_rococo_westend.sh $1 >$INVOKE_LOG 2>&1
popd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

RELAY_LOG=`mktemp -p $TEST_FOLDER relay.XXXXX`

pushd $POLKADOT_SDK_PATH/bridges/zombienet/environments/rococo-westend
pushd $POLKADOT_SDK_PATH/bridges/testing/environments/rococo-westend
./bridges_rococo_westend.sh run-relay >$RELAY_LOG 2>&1&
popd
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions bridges/zombienet/environments/rococo-westend/helper.sh

This file was deleted.

26 changes: 13 additions & 13 deletions cumulus/parachains/runtimes/bridge-hubs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ cd <polkadot-sdk-git-repo-dir>
# Rococo + BridgeHubRococo + AssetHub for Rococo (mirroring Kusama)
POLKADOT_BINARY=~/local_bridge_testing/bin/polkadot \
POLKADOT_PARACHAIN_BINARY=~/local_bridge_testing/bin/polkadot-parachain \
~/local_bridge_testing/bin/zombienet-linux --provider native spawn ./bridges/zombienet/environments/rococo-westend/bridge_hub_rococo_local_network.toml
~/local_bridge_testing/bin/zombienet-linux --provider native spawn ./bridges/testing/environments/rococo-westend/bridge_hub_rococo_local_network.toml
```

```
Expand All @@ -100,7 +100,7 @@ cd <polkadot-sdk-git-repo-dir>
# Westend + BridgeHubWestend + AssetHub for Westend (mirroring Polkadot)
POLKADOT_BINARY=~/local_bridge_testing/bin/polkadot \
POLKADOT_PARACHAIN_BINARY=~/local_bridge_testing/bin/polkadot-parachain \
~/local_bridge_testing/bin/zombienet-linux --provider native spawn ./bridges/zombienet/environments/rococo-westend/bridge_hub_westend_local_network.toml
~/local_bridge_testing/bin/zombienet-linux --provider native spawn ./bridges/testing/environments/rococo-westend/bridge_hub_westend_local_network.toml
```

### Init bridge and run relayer between BridgeHubRococo and BridgeHubWestend
Expand All @@ -112,7 +112,7 @@ POLKADOT_PARACHAIN_BINARY=~/local_bridge_testing/bin/polkadot-parachain \
```
cd <polkadot-sdk-git-repo-dir>

./bridges/zombienet/environments/rococo-westend/bridges_rococo_westend.sh run-relay
./bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh run-relay
```

**Check relay-chain headers relaying:**
Expand All @@ -135,10 +135,10 @@ This initialization does several things:
```
cd <polkadot-sdk-git-repo-dir>

./bridges/zombienet/environments/rococo-westend/bridges_rococo_westend.sh init-asset-hub-rococo-local
./bridges/zombienet/environments/rococo-westend/bridges_rococo_westend.sh init-bridge-hub-rococo-local
./bridges/zombienet/environments/rococo-westend/bridges_rococo_westend.sh init-asset-hub-westend-local
./bridges/zombienet/environments/rococo-westend/bridges_rococo_westend.sh init-bridge-hub-westend-local
./bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh init-asset-hub-rococo-local
./bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh init-bridge-hub-rococo-local
./bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh init-asset-hub-westend-local
./bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh init-bridge-hub-westend-local
```

### Send messages - transfer asset over bridge (ROCs/WNDs)
Expand All @@ -148,13 +148,13 @@ Do reserve-backed transfers:
cd <polkadot-sdk-git-repo-dir>

# ROCs from Rococo's Asset Hub to Westend's.
./bridges/zombienet/environments/rococo-westend/bridges_rococo_westend.sh reserve-transfer-assets-from-asset-hub-rococo-local
./bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh reserve-transfer-assets-from-asset-hub-rococo-local
```
```
cd <polkadot-sdk-git-repo-dir>

# WNDs from Westend's Asset Hub to Rococo's.
./bridges/zombienet/environments/rococo-westend/bridges_rococo_westend.sh reserve-transfer-assets-from-asset-hub-westend-local
./bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh reserve-transfer-assets-from-asset-hub-westend-local
```

- open explorers: (see zombienets)
Expand All @@ -169,13 +169,13 @@ Do reserve withdraw transfers: (when previous is finished)
cd <polkadot-sdk-git-repo-dir>

# wrappedWNDs from Rococo's Asset Hub to Westend's.
./bridges/zombienet/environments/rococo-westend/bridges_rococo_westend.sh withdraw-reserve-assets-from-asset-hub-rococo-local
./bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh withdraw-reserve-assets-from-asset-hub-rococo-local
```
```
cd <polkadot-sdk-git-repo-dir>

# wrappedROCs from Westend's Asset Hub to Rococo's.
./bridges/zombienet/environments/rococo-westend/bridges_rococo_westend.sh withdraw-reserve-assets-from-asset-hub-westend-local
./bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh withdraw-reserve-assets-from-asset-hub-westend-local
```

### Claim relayer's rewards on BridgeHubRococo and BridgeHubWestend
Expand All @@ -188,10 +188,10 @@ cd <polkadot-sdk-git-repo-dir>
cd <polkadot-sdk-git-repo-dir>

# Claim rewards on BridgeHubWestend:
./bridges/zombienet/environments/rococo-westend/bridges_rococo_westend.sh claim-rewards-bridge-hub-rococo-local
./bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh claim-rewards-bridge-hub-rococo-local

# Claim rewards on BridgeHubWestend:
./bridges/zombienet/environments/rococo-westend/bridges_rococo_westend.sh claim-rewards-bridge-hub-westend-local
./bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh claim-rewards-bridge-hub-westend-local
```

- open explorers: (see zombienets)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ LABEL io.parity.image.authors="devops-team@parity.io" \
io.parity.image.source="https://github.com/paritytech/polkadot-sdk/blob/${VCS_REF}/docker/dockerfiles/bridges_zombienet_tests_injected.Dockerfile" \
io.parity.image.revision="${VCS_REF}" \
io.parity.image.created="${BUILD_DATE}" \
io.parity.image.documentation="https://github.com/paritytech/polkadot-sdk/bridges/zombienet"
io.parity.image.documentation="https://github.com/paritytech/polkadot-sdk/bridges/testing"

# show backtraces
ENV RUST_BACKTRACE 1
Expand All @@ -45,7 +45,7 @@ RUN mkdir -p /home/nonroot/bridges-polkadot-sdk
COPY ./artifacts/bridges-polkadot-sdk /home/nonroot/bridges-polkadot-sdk
# also prepare `generate_hex_encoded_call` for running
RUN set -eux; \
cd /home/nonroot/bridges-polkadot-sdk/bridges/zombienet/utils/generate_hex_encoded_call; \
cd /home/nonroot/bridges-polkadot-sdk/bridges/testing/utils/generate_hex_encoded_call; \
npm install

# check if executable works in this container
Expand Down
Loading