Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

[Zombienet] add upgrade test #5970

Merged
merged 11 commits into from
Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
34 changes: 33 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ variables:
CI_IMAGE: "paritytech/ci-linux:production"
DOCKER_OS: "debian:stretch"
ARCH: "x86_64"
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.2.56"
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.2.61"
PIPELINE_SCRIPTS_TAG: "v0.4"

default:
Expand Down Expand Up @@ -231,6 +231,7 @@ build-linux-stable:
- echo "Polkadot version = ${VERSION} (EXTRATAG = ${EXTRATAG})"
- echo -n ${VERSION} > ./artifacts/VERSION
- echo -n ${EXTRATAG} > ./artifacts/EXTRATAG
- echo -n ${CI_JOB_ID} > ./artifacts/BUILD_LINUX_JOB_ID
- cp -r scripts/* ./artifacts

test-linux-stable:
Expand Down Expand Up @@ -868,6 +869,37 @@ zombienet-tests-misc-paritydb:
tags:
- zombienet-polkadot-integration-test

zombienet-tests-misc-upgrade-node:
stage: stage3
image: "${ZOMBIENET_IMAGE}"
<<: *kubernetes-env
<<: *zombienet-refs
needs:
- job: publish-polkadot-debug-image
- job: publish-test-collators-image
- job: build-linux-stable
artifacts: true
variables:
GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/misc"
before_script:
- echo "Zombie-net Tests Config"
- echo "${ZOMBIENET_IMAGE_NAME}"
- echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}"
- echo "${GH_DIR}"
- export DEBUG=zombie,zombie::network-node
- export ZOMBIENET_INTEGRATION_TEST_IMAGE="docker.io/parity/polkadot:latest"
- export COL_IMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG}
- BUILD_LINUX_JOB_ID="$(cat ./artifacts/BUILD_LINUX_JOB_ID)"
- export POLKADOT_PR_BIN_URL="https://gitlab.parity.io/parity/mirrors/polkadot/-/jobs/${BUILD_LINUX_JOB_ID}/artifacts/file/artifacts/polkadot"
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh
--github-remote-dir="${GH_DIR}"
--test="0002-upgrade-node.feature"
allow_failure: false
retry: 2
tags:
- zombienet-polkadot-integration-test

zombienet-tests-malus-dispute-valid:
stage: stage3
image: "${ZOMBIENET_IMAGE}"
Expand Down
15 changes: 15 additions & 0 deletions zombienet_tests/misc/0002-download-polkadot-from-pr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -euxo pipefail

TEMP_DIR=/tmp/zombie

# add /tmp/zombie as first `looking dir` to allow to overrides commands.
mkdir -p $TEMP_DIR
export PATH=$TEMP_DIR:$PATH

cd $TEMP_DIR
#curl -L -O https://gitlab.parity.io/parity/mirrors/polkadot/-/jobs/1810914/artifacts/file/artifacts/polkadot
pepoviola marked this conversation as resolved.
Show resolved Hide resolved
curl -L -O $POLKADOT_PR_BIN_URL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should determine the previous version rather than the latest one, so to ensure we don’t actually test downgrade. This could happen for prs on top of older branches.

chmod +x $TEMP_DIR/polkadot
echo $(polkadot --version)
19 changes: 19 additions & 0 deletions zombienet_tests/misc/0002-upgrade-node.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Description: Smoke / Upgrade Node
Network: ./0002-upgrade-node.toml
Creds: config

alice: is up
bob: is up
charlie: is up
dave: is up
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: do we need dave node for this test?


alice: reports block height is at least 10 within 200 seconds
alice: parachain 2000 block height is at least 10 within 200 seconds
bob: reports block height is at least 15 within 240 seconds
bob: parachain 2001 block height is at least 10 within 200 seconds
charlie: reports block height is at least 20 within 320 seconds
# upgrade both nodes
alice: run ./0002-upgrade.sh within 200 seconds
bob: run ./0002-upgrade.sh within 200 seconds
alice: reports block height is at least 40 within 200 seconds
bob: reports block height is at least 40 within 200 seconds
pepoviola marked this conversation as resolved.
Show resolved Hide resolved
49 changes: 49 additions & 0 deletions zombienet_tests/misc/0002-upgrade-node.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[settings]
timeout = 1000

[relaychain]
default_image = "{{ZOMBIENET_INTEGRATION_TEST_IMAGE}}"
chain = "rococo-local"


[[relaychain.nodes]]
name = "alice"
args = [ "-lparachain=debug,runtime=debug", "--db paritydb" ]

[[relaychain.nodes]]
name = "bob"
args = [ "-lparachain=debug,runtime=debug", "--db rocksdb"]

[[relaychain.nodes]]
name = "charlie"
args = [ "-lparachain=debug,runtime=debug" ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default is rocksdb, can we have 2 nodes using paritydb and 2 with rocksdb?


[[relaychain.nodes]]
name = "dave"
args = [ "-lparachain=debug,runtime=debug" ]


[[parachains]]
id = 2000
addToGenesis = true

[parachains.collator]
name = "collator01"
image = "{{COL_IMAGE}}"
command = "undying-collator"
args = ["-lparachain=debug"]

[[parachains]]
id = 2001
addToGenesis = true

[parachains.collator]
name = "collator02"
image = "{{COL_IMAGE}}"
command = "undying-collator"
args = ["-lparachain=debug"]

[types.Header]
number = "u64"
parent_hash = "Hash"
post_state = "Hash"