Skip to content

Commit

Permalink
Add multiple networks CI test + example
Browse files Browse the repository at this point in the history
  • Loading branch information
serban300 committed Mar 22, 2023
1 parent 6a38a6e commit 21249c2
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -459,3 +459,32 @@ db-snapshot:
retry: 2
tags:
- zombienet-polkadot-integration-test

multiple-networks:
stage: deploy
<<: *kubernetes-env
image: "paritypr/zombienet:${CI_COMMIT_SHORT_SHA}"
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
# needs:
# - job: publish-docker-pr

variables:
GH_DIR: "https://github.com/paritytech/zombienet/tree/${CI_COMMIT_SHORT_SHA}/tests"

before_script:
- echo "Zombienet multiple networks test"
- echo "paritypr/zombienet:${CI_COMMIT_SHORT_SHA}"
- echo "${GH_DIR}"
- export DEBUG=zombie*

script:
- /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
--test="0014-multiple-networks.zndsl"
allow_failure: true
retry: 2
tags:
- zombienet-polkadot-integration-test
17 changes: 17 additions & 0 deletions examples/0005-multiple-networks.zndsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Description: Multiple Networks test
Network: ./0000-test-config-small-network.toml
Network: ./0003-big-network.toml
Creds: config

# 0000-test-config-small-network - metrics
alice: reports node_roles is 4
alice: reports sub_libp2p_is_major_syncing is 0

# 0000-test-config-small-network - logs
bob: log line matches glob "*rted #1*" within 10 seconds
bob: log line matches "Imported #[0-9]+" within 10 seconds

# 0003-big-network - metrics
a: reports node_roles is 4
b: reports sub_libp2p_is_major_syncing is 0

16 changes: 16 additions & 0 deletions tests/0014-multiple-networks.zndsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Description: Multiple Networks test
Network: ./0014-network-1.toml
Network: ./0014-network-2.toml
Creds: config

# network-1 - metrics
alice: reports node_roles is 4
alice: reports sub_libp2p_is_major_syncing is 0

# network-1 - logs
bob: log line matches glob "*rted #1*" within 10 seconds
bob: log line matches "Imported #[0-9]+" within 10 seconds

# network-2 - metrics
a: reports node_roles is 4
b: reports sub_libp2p_is_major_syncing is 0
16 changes: 16 additions & 0 deletions tests/0014-network-1.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[relaychain]
default_image = "docker.io/parity/polkadot:latest"
default_command = "polkadot"
default_args = [ "-lparachain=debug" ]

chain = "rococo-local"

[[relaychain.nodes]]
name = "alice"
validator = true

[[relaychain.nodes]]
name = "bob"
image = "docker.io/parity/polkadot:latest"
validator = true
args = ["--database=paritydb-experimental"]
25 changes: 25 additions & 0 deletions tests/0014-network-2.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[relaychain]
default_image = "docker.io/parity/polkadot:latest"
default_command = "polkadot"
default_args = [ "-lparachain=debug" ]

chain = "rococo-local"

[[relaychain.node_groups]]
name = "a"
args = [ "-lparachain=debug", "--database=paritydb-experimental" ]
count = 5

[[relaychain.node_groups]]
name = "b"
count = 5

[[parachains]]
id = 100

[[parachains.collator_groups]]
count = 2
[parachains.collator_groups.collator]
name = "collator"
command = "polkadot-parachain"
image = "docker.io/parity/polkadot-parachain:latest"

0 comments on commit 21249c2

Please sign in to comment.