Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(tests): use smoke test in k8s #964

Merged
merged 4 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
179 changes: 9 additions & 170 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,123 +174,17 @@ publish-docker-image-description:
script:
- cd / && sh entrypoint.sh

zombienet-restart-pause-resume:
zombienet-smoke:
stage: deploy
<<: *kubernetes-env
image: "paritypr/zombienet:${CI_COMMIT_SHORT_SHA}"
<<: *common-refs

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

before_script:
- echo "Zombienet Tests Logs"
- echo "paritypr/zombienet:${CI_COMMIT_SHORT_SHA}"
- echo "${GH_DIR}"
- export DEBUG=zombie*
- export ZOMBIENET_INTEGRATION_TEST_IMAGE="docker.io/paritypr/polkadot-debug:master"
- export COL_IMAGE="docker.io/paritypr/colander:master"

script:
- /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
--test="0002-restart-pause-resume-node.zndsl"
allow_failure: true
retry: 2
tags:
- zombienet-polkadot-integration-test

zombienet-logs-assertion:
stage: deploy
<<: *kubernetes-env
image: "paritypr/zombienet:${CI_COMMIT_SHORT_SHA}"
<<: *common-refs

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

before_script:
- echo "Zombienet Tests Logs"
- echo "paritypr/zombienet:${CI_COMMIT_SHORT_SHA}"
- echo "${GH_DIR}"
- export DEBUG=zombie*
- export ZOMBIENET_INTEGRATION_TEST_IMAGE="docker.io/paritypr/polkadot-debug:master"
- export COL_IMAGE="docker.io/paritypr/colander:master"

script:
- /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
--test="0006-logs.zndsl"
allow_failure: true
retry: 2
tags:
- zombienet-polkadot-integration-test

zombienet-system-event-assertion:
stage: deploy
<<: *kubernetes-env
image: "paritypr/zombienet:${CI_COMMIT_SHORT_SHA}"
<<: *common-refs

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

before_script:
- echo "Zombienet Tests System Event"
- echo "paritypr/zombienet:${CI_COMMIT_SHORT_SHA}"
- echo "${GH_DIR}"
- export DEBUG=zombie*
- export ZOMBIENET_INTEGRATION_TEST_IMAGE="docker.io/paritypr/polkadot-debug:master"
- export COL_IMAGE="docker.io/paritypr/colander:master"

script:
- /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
--test="0007-events.zndsl"
allow_failure: true
retry: 2
tags:
- zombienet-polkadot-integration-test

zombienet-custom-scripts-assertion:
stage: deploy
<<: *kubernetes-env
image: "paritypr/zombienet:${CI_COMMIT_SHORT_SHA}"
<<: *common-refs

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

before_script:
- echo "Zombienet Tests Custom Scripts (js, sh)"
- echo "paritypr/zombienet:${CI_COMMIT_SHORT_SHA}"
- echo "${GH_DIR}"
- export DEBUG=zombie*
- export ZOMBIENET_INTEGRATION_TEST_IMAGE="docker.io/paritypr/polkadot-debug:master"
- export COL_IMAGE="docker.io/paritypr/colander:master"

script:
- /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
--test="0008-custom-scripts.zndsl"
allow_failure: true
retry: 2
tags:
- zombienet-polkadot-integration-test

zombienet-histogram-assertion:
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"
GH_DIR: "https://github.com/paritytech/zombienet/tree/${CI_COMMIT_SHORT_SHA}/tests/smoke"

before_script:
- echo "Zombienet Tests Histogram"
- echo "Zombienet Smoke Tests"
- echo "paritypr/zombienet:${CI_COMMIT_SHORT_SHA}"
- echo "${GH_DIR}"
- export DEBUG=zombie*
Expand All @@ -299,54 +193,17 @@ zombienet-histogram-assertion:

script:
- /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
--test="0010-histogram-smoke-test.zndsl"
allow_failure: true
retry: 2
tags:
- zombienet-polkadot-integration-test

zombienet-update-genesis-config:
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 Tests Genesis config update"
- echo "paritypr/zombienet:${CI_COMMIT_SHORT_SHA}"
- echo "${GH_DIR}"
- export DEBUG=zombie*
- export ZOMBIENET_INTEGRATION_TEST_IMAGE="docker.io/paritypr/polkadot-debug:master"
- export COL_IMAGE="docker.io/paritypr/colander:master"

script:
- /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
--test="0011-update-genesis-config.zndsl"
allow_failure: true
--test="0001-smoke.zndsl"
allow_failure: false
retry: 2
tags:
- zombienet-polkadot-integration-test

zombienet-scale-net-config:
stage: deploy
<<: *kubernetes-env
<<: *common-refs
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/scale-net"
Expand All @@ -370,14 +227,8 @@ zombienet-scale-net-config:
zombienet-upgrade-node:
stage: deploy
<<: *kubernetes-env
<<: *common-refs
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/k8s"
Expand All @@ -401,14 +252,8 @@ zombienet-upgrade-node:
paras:
stage: deploy
<<: *kubernetes-env
<<: *common-refs
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/paras"
Expand All @@ -434,14 +279,8 @@ paras:
db-snapshot:
stage: deploy
<<: *kubernetes-env
<<: *common-refs
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"
Expand Down
5 changes: 2 additions & 3 deletions tests/smoke/0001-smoke.zndsl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ bob: is up
# Logs assertions
alice: reports block height is at least 4 within 200 seconds
alice: log line contains "Imported #2" within 20 seconds
alice: log line matches glob "*rted #1*" within 10 seconds
alice: log line matches glob "*rted #2*" within 20 seconds
alice: log line matches "Imported #[0-9]+" within 10 seconds
alice: count of log lines containing "imported" is at least 4 within 10 seconds

Expand All @@ -35,7 +35,6 @@ alice: restart after 20 seconds
sleep 25 seconds
alice: is up
alice: pause
# Todo add `should fail` support
# alice: is down
sleep 2 seconds
alice: resume
alice: is up within 120 seconds