From 19292a1b292d7bf015a4ef8c4cf691a6c9694596 Mon Sep 17 00:00:00 2001 From: Javier Viola Date: Wed, 22 Dec 2021 07:46:52 -0300 Subject: [PATCH] run parachain smoke test in ci (#44) * wip run test in ci * update images * fix ci * typo * more wip in ci * typo * typo * debug ci * more debug * reorder config * run the test * use pr image * fix echo for image version --- .gitlab-ci.yml | 53 +++++++++++++++++++++++++++++++++++++++++++++++++- package.json | 6 ++++-- tsconfig.json | 2 +- 3 files changed, 57 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ca9e71f27..c8e69ebd7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,10 +8,12 @@ default: stages: - lint - - test - build + - test + - package - check - publish + - deploy variables: CI_IMAGE: "node:16.10" @@ -31,7 +33,9 @@ variables: rules: - if: $CI_PIPELINE_SOURCE == "web" - if: $CI_PIPELINE_SOURCE == "schedule" + - if: $CI_COMMIT_REF_NAME == "main" - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs + - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 .common-refs: &common-refs rules: @@ -87,6 +91,21 @@ build: - cp -r dist/ artifacts/ - cp package* artifacts/ +package: + stage: package + <<: *kubernetes-env + <<: *common-refs + <<: *collect-artifacts + needs: + - job: build + script: + - mkdir -p artifacts + - npm install + - npm run clean + - npm run build + - npm run package + - cp zombienet-* artifacts/ + # template task for building and pushing an image .build-push-docker-image: &build-push-docker-image @@ -157,3 +176,35 @@ publish-docker: <<: *kubernetes-env <<: *publish-refs <<: *build-push-docker-image + +zombienet-tests-integration: + 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/polkadot/tree/master/zombienet_tests/parachains' + + before_script: + - echo "Zombie-net Tests Config" + - echo "paritypr/zombienet:${CI_COMMIT_SHORT_SHA}" + - echo "${GH_DIR}" + - export DEBUG=zombie* + - export ZOMBIENET_INTEGRATION_TEST_IMAGE="docker.io/paritypr/synth-wave:master" + - export COL_IMAGE="docker.io/paritypr/colander:master" + + script: + - /home/nonroot/zombie-net/scripts/run-test-env-manager.sh + --github-remote-dir="${GH_DIR}" + --test="0001-parachains-smoke-test.feature" + allow_failure: true + retry: 2 + tags: + - zombienet-polkadot-integration-test diff --git a/package.json b/package.json index 0911b70a3..205499777 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "clean": "rm -rf ./dist/* ", "build": "tsc", "start": "yarn build && node dist/cli.js", - "lint": "npx prettier --write ." + "lint": "npx prettier --write .", + "package": "pkg ." }, "dependencies": { "@polkadot/api": "^6.1.2", @@ -46,6 +47,7 @@ "@types/tmp": "^0.2.1", "prettier": "2.2.1", "typescript": "^4.1.5", - "yarn": "^1.22.10" + "yarn": "^1.22.10", + "pkg": "~5.5.1" } } diff --git a/tsconfig.json b/tsconfig.json index 82cc899c8..07e0f4a84 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,5 +11,5 @@ "declaration": true, "rootDir": "./src" }, - "exclude": ["node_modules", "dist", "test", "local-utils"] + "exclude": ["node_modules", "dist", "test", "local-utils", "artifacts"] }