Skip to content

Commit

Permalink
integration tests: start new node after runtime upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
mnaamani committed Apr 14, 2023
1 parent 7642067 commit 4a21288
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions tests/network-tests/run-runtime-upgrade-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,16 @@ function create_raw_chain_spec() {
}

# Start a chain with generated chain spec
function start_old_joystream_node {
docker-compose -f ../../docker-compose.yml run -d -v ${DATA_PATH}:/spec --name joystream-node \
function start_joystream_node {
docker-compose -f ../../docker-compose.yml run -d -v ${DATA_PATH}:/spec \
-v ${DATA_PATH}/chain:/chain \
--name joystream-node \
-p 9944:9944 -p 9933:9933 joystream-node \
--validator --unsafe-ws-external --unsafe-rpc-external \
--rpc-methods Unsafe --rpc-cors=all -l runtime \
--chain /spec/chain-spec-forked.json --pruning=archive --no-telemetry \
--keystore-path /spec/keystore/auth-0
--keystore-path /spec/keystore/auth-0 \
--base-path /chain
}

#######################################
Expand Down Expand Up @@ -179,10 +182,8 @@ function main {
# 4. copy chainspec to disk
export_chainspec_file_to_disk
echo >&2 "chainspec exported"
# 5. start node using new binary to test rpc endpoint code being different
# than runtime version to look for breaking decoding of types early.
export JOYSTREAM_NODE_TAG=${TARGET_RUNTIME}
CONTAINER_ID=$(start_old_joystream_node)
# 5. start node
CONTAINER_ID=$(start_joystream_node)
echo >&2 "mainnet node starting"

# Wait for chain and query node to get in sync
Expand All @@ -196,6 +197,16 @@ function main {
fi

./run-test-scenario.sh runtimeUpgrade

# 7. start node using new binary
docker stop ${CONTAINER_ID}
docker rm ${CONTAINER_ID}
export JOYSTREAM_NODE_TAG=${TARGET_RUNTIME}
CONTAINER_ID=$(start_joystream_node)
echo >&2 "restarting node with new binary"

sleep 90

./run-test-scenario.sh content-directory
}

Expand Down

0 comments on commit 4a21288

Please sign in to comment.