From d9eafe4a68aaa22e30c7c13708cc96586ed2cdf3 Mon Sep 17 00:00:00 2001 From: Javier Viola Date: Tue, 25 Apr 2023 09:43:07 -0300 Subject: [PATCH 1/4] use smoke test in k8s --- .gitlab-ci.yml | 179 +++---------------------------------------------- 1 file changed, 9 insertions(+), 170 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6574ad417..2fe63effc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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* @@ -299,39 +193,8 @@ 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 @@ -339,14 +202,8 @@ zombienet-update-genesis-config: 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" @@ -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" @@ -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" @@ -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" From 03e16652b91d9e0e03e7259085d80352b0bc4af9 Mon Sep 17 00:00:00 2001 From: Javier Viola Date: Tue, 25 Apr 2023 18:07:35 -0300 Subject: [PATCH 2/4] add sleep --- tests/smoke/0001-smoke.zndsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/smoke/0001-smoke.zndsl b/tests/smoke/0001-smoke.zndsl index 34f6a1237..65f54ca14 100644 --- a/tests/smoke/0001-smoke.zndsl +++ b/tests/smoke/0001-smoke.zndsl @@ -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 #1" 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 @@ -37,5 +37,6 @@ alice: is up alice: pause # Todo add `should fail` support # alice: is down +sleep 2 seconds alice: resume alice: is up within 120 seconds From 0b4e41001c021398aa494c71204b90bb1ab719ae Mon Sep 17 00:00:00 2001 From: Javier Viola Date: Tue, 25 Apr 2023 18:20:13 -0300 Subject: [PATCH 3/4] remove todo in test --- tests/smoke/0001-smoke.zndsl | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/smoke/0001-smoke.zndsl b/tests/smoke/0001-smoke.zndsl index 65f54ca14..af3c2e2ce 100644 --- a/tests/smoke/0001-smoke.zndsl +++ b/tests/smoke/0001-smoke.zndsl @@ -35,8 +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 From e1f4908b618371ad2ecebdea89f1b3d22cfb0ba9 Mon Sep 17 00:00:00 2001 From: Javier Viola Date: Tue, 25 Apr 2023 18:33:21 -0300 Subject: [PATCH 4/4] fix glob --- tests/smoke/0001-smoke.zndsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/smoke/0001-smoke.zndsl b/tests/smoke/0001-smoke.zndsl index af3c2e2ce..c331eab45 100644 --- a/tests/smoke/0001-smoke.zndsl +++ b/tests/smoke/0001-smoke.zndsl @@ -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 20 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