Skip to content

Commit

Permalink
Add quick simnet tests to .gitlab-ci.yml (paritytech#9959)
Browse files Browse the repository at this point in the history
* remove spaces

* add simnet quick test

* debug simnet test

* add jobs for quick simnet tests

* fix typo

* test simnet-quick

* remove debug

* fix ci

* change tag for simnet tests

* Add new line to readme
  • Loading branch information
alvicsam authored Oct 11, 2021
1 parent 582db90 commit 85d881b
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 4 deletions.
69 changes: 65 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ variables: &default-vars
VAULT_SERVER_URL: "https://vault.parity-mgmt-vault.parity.io"
VAULT_AUTH_PATH: "gitlab-parity-io-jwt"
VAULT_AUTH_ROLE: "cicd_gitlab_parity_${CI_PROJECT_NAME}"
SIMNET_FEATURES_PATH: "simnet_tests/tests"

default:
cache: {}
Expand All @@ -57,6 +58,14 @@ default:
paths:
- artifacts/

.collect-artifacts-short: &collect-artifacts-short
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
when: on_success
expire_in: 3 hours
paths:
- artifacts/

.kubernetes-env: &kubernetes-env
retry:
max: 2
Expand Down Expand Up @@ -188,13 +197,13 @@ default:
file: false
AWX_TOKEN:
vault: cicd/gitlab/$CI_PROJECT_PATH/AWX_TOKEN@kv
file: false
file: false
CRATES_TOKEN:
vault: cicd/gitlab/$CI_PROJECT_PATH/CRATES_TOKEN@kv
file: false
DOCKER_CHAOS_TOKEN:
vault: cicd/gitlab/$CI_PROJECT_PATH/DOCKER_CHAOS_TOKEN@kv
file: false
file: false
DOCKER_CHAOS_USER:
vault: cicd/gitlab/$CI_PROJECT_PATH/DOCKER_CHAOS_USER@kv
file: false
Expand Down Expand Up @@ -580,6 +589,12 @@ build-linux-substrate: &build-binary
- cp -r .maintain/docker/substrate.Dockerfile ./artifacts/substrate/
- sccache -s

#Build binary for simnet quick tests.
build-linux-substrate-simnet:
<<: *build-binary
<<: *collect-artifacts-short
<<: *test-refs-no-trigger-prs-only

build-linux-subkey: &build-subkey
stage: build
<<: *collect-artifacts
Expand Down Expand Up @@ -689,6 +704,25 @@ publish-docker-substrate:
# https://docs.gitlab.com/ee/ci/multi_project_pipelines.html#with-variable-inheritance
dotenv: ./artifacts/substrate/build.env

#publish artifact for quick simnet tests
publish-docker-substrate-simnet:
stage: publish
<<: *build-push-docker-image
<<: *test-refs-no-trigger-prs-only
needs:
- job: build-linux-substrate-simnet
artifacts: true
variables:
<<: *default-vars
GIT_STRATEGY: none
DOCKERFILE: $PRODUCT.Dockerfile
PRODUCT: substrate
IMAGE_NAME: docker.io/paritypr/$PRODUCT
artifacts:
reports:
# this artifact is used in simnet-tests-quick job
dotenv: ./artifacts/substrate/build.env

publish-docker-subkey:
stage: publish
<<: *build-push-docker-image
Expand Down Expand Up @@ -871,12 +905,39 @@ simnet-tests:
before_script:
- echo "Simnet Tests Config
docker.io/paritytech/simnet:${SIMNET_REF}
${SUBSTRATE_IMAGE_NAME} ${SUBSTRATE_IAMGE_TAG}"
${SUBSTRATE_IMAGE_NAME} ${SUBSTRATE_IMAGE_TAG}"
script:
- /home/nonroot/simnet/gurke/scripts/run-test-environment-manager.sh
--github-remote-dir="https://github.com/paritytech/substrate/tree/master/simnet_tests"
--config="simnet_tests/configs/default_local_testnet.toml"
--image="${SUBSTRATE_IMAGE_NAME}:${SUBSTRATE_IMAGE_TAG}"
retry: 2
tags:
- parity-simnet
- substrate-simnet

#run quick simnet-tests for each PR
simnet-tests-quick:
stage: deploy
image: docker.io/paritytech/simnet:${SIMNET_REF}
<<: *kubernetes-env
<<: *vault-secrets
<<: *test-refs-no-trigger-prs-only
variables:
SIMNET_FEATURES: "${SIMNET_FEATURES_PATH}/quick"
needs:
- job: publish-docker-substrate-simnet
before_script:
- echo "Simnet Tests Config
docker.io/paritytech/simnet:${SIMNET_REF}
${SUBSTRATE_IMAGE_NAME} ${SUBSTRATE_IMAGE_TAG}"
script:
- echo "Image=${SUBSTRATE_IMAGE_NAME}:${SUBSTRATE_IMAGE_TAG}"
- echo "Features=${SIMNET_FEATURES}"
- /home/nonroot/simnet/gurke/scripts/run-test-environment-manager.sh
--github-remote-dir="https://github.com/paritytech/substrate/tree/master/simnet_tests"
--config="simnet_tests/configs/default_local_testnet.toml"
--image="${SUBSTRATE_IMAGE_NAME}:${SUBSTRATE_IMAGE_TAG}"
--features="${SIMNET_FEATURES}"
tags:
- substrate-simnet

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ The security policy and procedures can be found in [`docs/SECURITY.md`](docs/SEC
The reason for the split-licensing is to ensure that for the vast majority of teams using Substrate to create feature-chains, then all changes can be made entirely in Apache2-licensed code, allowing teams full freedom over what and how they release and giving licensing clarity to commercial teams.

In the interests of the community, we require any deeper improvements made to Substrate's core logic (e.g. Substrate's internal consensus, crypto or database code) to be contributed back so everyone can benefit.

0 comments on commit 85d881b

Please sign in to comment.