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

Add async-backing zombienet tests #6314

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ variables:
BUILDAH_IMAGE: "quay.io/buildah/stable:v1.27"
DOCKER_OS: "debian:stretch"
ARCH: "x86_64"
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.2.78"
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.16"

default:
cache: {}
Expand Down
97 changes: 97 additions & 0 deletions scripts/ci/gitlab/pipeline/zombienet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,3 +299,100 @@ zombienet-tests-beefy-and-mmr:
retry: 2
tags:
- zombienet-polkadot-integration-test

zombienet-tests-async-backing-compatibility:
stage: zombienet
extends:
- .kubernetes-env
- .zombienet-refs
image: "${ZOMBIENET_IMAGE}"
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/async_backing"
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
- BUILD_RELEASE_VERSION="$(cat ./artifacts/BUILD_RELEASE_VERSION)"
- export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG}
- export ZOMBIENET_INTEGRATION_TEST_SECONDARY_IMAGE="docker.io/parity/polkadot:${BUILD_RELEASE_VERSION}"
- export COL_IMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG}
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh
--github-remote-dir="${GH_DIR}"
--test="001-async-backing-compatibility.zndsl"
allow_failure: false
retry: 2
tags:
- zombienet-polkadot-integration-test

zombienet-tests-async-backing-runtime-upgrade:
stage: zombienet
extends:
- .kubernetes-env
- .zombienet-refs
image: "${ZOMBIENET_IMAGE}"
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/async_backing"
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
- BUILD_RELEASE_VERSION="$(cat ./artifacts/BUILD_RELEASE_VERSION)"
- export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG}
- export ZOMBIENET_INTEGRATION_TEST_SECONDARY_IMAGE="docker.io/parity/polkadot:${BUILD_RELEASE_VERSION}"
- export COL_IMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG}
- export POLKADOT_PR_BIN_URL="https://gitlab.parity.io/parity/mirrors/polkadot/-/jobs/${BUILD_LINUX_JOB_ID}/artifacts/raw/artifacts/polkadot"
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh
--github-remote-dir="${GH_DIR}"
--test="002-async-backing-runtime-upgrade.zndsl"
allow_failure: false
retry: 2
tags:
- zombienet-polkadot-integration-test

zombienet-tests-async-backing-collator-mix:
stage: zombienet
extends:
- .kubernetes-env
- .zombienet-refs
image: "${ZOMBIENET_IMAGE}"
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/async_backing"
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
- BUILD_RELEASE_VERSION="$(cat ./artifacts/BUILD_RELEASE_VERSION)"
- export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG}
- export ZOMBIENET_INTEGRATION_TEST_SECONDARY_IMAGE="docker.io/parity/polkadot:${BUILD_RELEASE_VERSION}"
- export COL_IMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG}
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh
--github-remote-dir="${GH_DIR}"
--test="003-async-backing-collator-mix.zndsl"
allow_failure: false
retry: 2
tags:
- zombienet-polkadot-integration-test
34 changes: 34 additions & 0 deletions zombienet_tests/async_backing/001-async-backing-compatibility.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[settings]
timeout = 1000

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

[relaychain.default_resources]
limits = { memory = "4G", cpu = "2" }
requests = { memory = "2G", cpu = "1" }

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

[[relaychain.nodes]]
name = "bob"
image = "{{ZOMBIENET_INTEGRATION_TEST_SECONDARY_IMAGE}}"
args = [ "-lparachain=debug,runtime=debug"]

[[parachains]]
id = 100

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

[types.Header]
number = "u64"
parent_hash = "Hash"
post_state = "Hash"
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Description: Async Backing Compatibility Test
Network: ./001-async-backing-compatibility.toml
Creds: config

# General
alice: is up
bob: is up

# Check authority status
alice: reports node_roles is 4
bob: reports node_roles is 4

# Check peers
alice: reports peers count is at least 2 within 20 seconds
bob: reports peers count is at least 2 within 20 seconds

# Parachain registration
alice: parachain 100 is registered within 225 seconds
bob: parachain 100 is registered within 225 seconds

# Ensure parachain progress
alice: parachain 100 block height is at least 10 within 250 seconds
bob: parachain 100 block height is at least 10 within 250 seconds
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"
default_command = "polkadot"

[relaychain.default_resources]
limits = { memory = "4G", cpu = "2" }
requests = { memory = "2G", cpu = "1" }

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

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

[[relaychain.nodes]]
name = "charlie"
image = "{{ZOMBIENET_INTEGRATION_TEST_SECONDARY_IMAGE}}"
args = [ "-lparachain=debug,runtime=debug"]

[[relaychain.nodes]]
name = "dave"
image = "{{ZOMBIENET_INTEGRATION_TEST_SECONDARY_IMAGE}}"
args = [ "-lparachain=debug,runtime=debug"]

[[parachains]]
id = 100
addToGenesis = true

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

[[parachains]]
id = 101
addToGenesis = true

[parachains.collator]
name = "collator02"
image = "{{COL_IMAGE}}"
command = "undying-collator"
args = ["-lparachain=debug"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Description: Async Backing Runtime Upgrade Test
Network: ./002-async-backing-runtime-upgrade.toml
Creds: config

# General
alice: is up
bob: is up
charlie: is up
dave: is up

# Check peers
alice: reports peers count is at least 3 within 20 seconds
bob: reports peers count is at least 3 within 20 seconds

# Parachain registration
alice: parachain 100 is registered within 225 seconds
bob: parachain 100 is registered within 225 seconds
charlie: parachain 100 is registered within 225 seconds
dave: parachain 100 is registered within 225 seconds
alice: parachain 101 is registered within 225 seconds
bob: parachain 101 is registered within 225 seconds
charlie: parachain 101 is registered within 225 seconds
dave: parachain 101 is registered within 225 seconds

# Ensure parachain progress
alice: parachain 100 block height is at least 10 within 250 seconds
bob: parachain 100 block height is at least 10 within 250 seconds

# Runtime upgrade (according to previous runtime tests, avg. is 30s)
alice: run ../misc/0002-download-polkadot-from-pr.sh with "{{POLKADOT_PR_BIN_URL}}" within 40 seconds
bob: run ../misc/0002-download-polkadot-from-pr.sh with "{{POLKADOT_PR_BIN_URL}}" within 40 seconds

# Bootstrap the runtime upgrade
sleep 30 seconds

alice: restart after 5 seconds
bob: restart after 5 seconds
Copy link
Contributor

Choose a reason for hiding this comment

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

why restart?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Took this from the previous runtime-upgrade file. If it is not required, happy to remove it.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, restarts are not required after a runtime upgrade


alice: is up within 10 seconds
bob: is up within 10 seconds

alice: parachain 100 block height is at least 10 within 250 seconds
bob: parachain 101 block height is at least 10 within 250 seconds
40 changes: 40 additions & 0 deletions zombienet_tests/async_backing/003-async-backing-collator-mix.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[settings]
timeout = 1000

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

[relaychain.default_resources]
limits = { memory = "4G", cpu = "2" }
requests = { memory = "2G", cpu = "1" }

[[relaychain.nodes]]
name = "alice"
args = [ "-lparachain=debug"]

[[relaychain.nodes]]
name = "bob"
image = "{{ZOMBIENET_INTEGRATION_TEST_SECONDARY_IMAGE}}"
args = [ "-lparachain=debug"]

[[parachains]]
id = 100

[[parachains.collators]]
name = "collator01"
image = "docker.io/paritypr/colander:master"
command = "undying-collator"
args = ["-lparachain=debug"]

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

[types.Header]
number = "u64"
parent_hash = "Hash"
post_state = "Hash"
21 changes: 21 additions & 0 deletions zombienet_tests/async_backing/003-async-backing-collator-mix.zndsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Description: Async Backing Collator Mix Test
Network: ./003-async-backing-collator-mix.toml
Creds: config

# General
alice: is up
bob: is up
charlie: is up
dave: is up

# Check peers
alice: reports peers count is at least 3 within 20 seconds
bob: reports peers count is at least 3 within 20 seconds

# Parachain registration
alice: parachain 100 is registered within 225 seconds
bob: parachain 100 is registered within 225 seconds

# Ensure parachain progress
alice: parachain 100 block height is at least 10 within 250 seconds
bob: parachain 100 block height is at least 10 within 250 seconds
9 changes: 9 additions & 0 deletions zombienet_tests/async_backing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# async-backing zombienet tests

This directory contains zombienet tests made explicitly for the async-backing feature branch.

## coverage

- Network protocol upgrade deploying both master and async branch (compatibility).
- Runtime ugprade while running both master and async backing branch nodes.
- Async backing test with a mix of collators collating via async backing and sync backing.