Skip to content

Commit

Permalink
run parachain smoke test in ci (#44)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
pepoviola authored Dec 22, 2021
1 parent 8be8e87 commit 19292a1
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 4 deletions.
53 changes: 52 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ default:

stages:
- lint
- test
- build
- test
- package
- check
- publish
- deploy

variables:
CI_IMAGE: "node:16.10"
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"declaration": true,
"rootDir": "./src"
},
"exclude": ["node_modules", "dist", "test", "local-utils"]
"exclude": ["node_modules", "dist", "test", "local-utils", "artifacts"]
}

0 comments on commit 19292a1

Please sign in to comment.