Files
pezkuwi-subxt/bridges/zombienet/run-new-test.sh
T
Serban Iorga dfc8e4696c Bridge zombienet tests refactoring (#3260)
Related to https://github.com/paritytech/polkadot-sdk/issues/3242

Reorganizing the bridge zombienet tests in order to:
- separate the environment spawning from the actual tests
- offer better control over the tests and some possibility to
orchestrate them as opposed to running everything from the zndsl file

Only rewrote the asset transfer test using this new "framework". The old
logic and old tests weren't functionally modified or deleted. The plan
is to get feedback on this approach first and if this is agreed upon,
migrate the other 2 tests later in separate PRs and also do other
improvements later.
2024-02-12 09:55:57 +00:00

47 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
set -e
test=$1
shift
# whether to use paths for zombienet+bridges tests container or for local testing
ZOMBIENET_DOCKER_PATHS=0
while [ $# -ne 0 ]
do
arg="$1"
case "$arg" in
--docker)
ZOMBIENET_DOCKER_PATHS=1
;;
esac
shift
done
export POLKADOT_SDK_PATH=`realpath ${BASH_SOURCE%/*}/../..`
# set path to binaries
if [ "$ZOMBIENET_DOCKER_PATHS" -eq 1 ]; then
# otherwise zombienet uses some hardcoded paths
unset RUN_IN_CONTAINER
unset ZOMBIENET_IMAGE
export POLKADOT_BINARY=/usr/local/bin/polkadot
export POLKADOT_PARACHAIN_BINARY=/usr/local/bin/polkadot-parachain
export ZOMBIENET_BINARY=/usr/local/bin/zombie
export SUBSTRATE_RELAY_BINARY=/usr/local/bin/substrate-relay
else
export POLKADOT_BINARY=$POLKADOT_SDK_PATH/target/release/polkadot
export POLKADOT_PARACHAIN_BINARY=$POLKADOT_SDK_PATH/target/release/polkadot-parachain
export ZOMBIENET_BINARY=~/local_bridge_testing/bin/zombienet-linux-x64
export SUBSTRATE_RELAY_BINARY=~/local_bridge_testing/bin/substrate-relay
fi
export TEST_DIR=`mktemp -d /tmp/bridges-tests-run-XXXXX`
echo -e "Test folder: $TEST_DIR\n"
${BASH_SOURCE%/*}/tests/$test/run.sh
kill -9 -$$ || echo "Environment already teared down"