Skip to content

Commit

Permalink
Simnet v8 move tests (paritytech#3647)
Browse files Browse the repository at this point in the history
* Update to simnet v8

* rm duplicate

* add tags also

* revertme: add simnet image version for testing CI

* add info regarding the image names and values

* fix lint error

* one more try to fix the lint

* hardcode simnet version and revertme

* hardcode simnet

* more hardcodding

* I wonder how may silly mistakes I can make

* simnet image name needs to be hardcoded

* Update .gitlab-ci.yml

Co-authored-by: Denis Pisarev <[email protected]>

* Update .gitlab-ci.yml

Co-authored-by: Denis Pisarev <[email protected]>

* remove revertme changes

* rm unused script

Co-authored-by: Denis Pisarev <[email protected]>
  • Loading branch information
radupopa2010 and TriplEight authored Aug 17, 2021
1 parent 41bd7cc commit 8e47e3c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 228 deletions.
62 changes: 36 additions & 26 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,6 @@ build-rustdoc:
- buildah push --format=v2s2 "$IMAGE_NAME:$EXTRATAG"
after_script:
- buildah logout "$IMAGE_NAME"
# pass artifacts to the trigger-simnet job
- echo "IMAGE_NAME=${IMAGE_NAME}" > ./artifacts/build.env
- echo "IMAGE_TAG=$(cat ./artifacts/EXTRATAG)" >> ./artifacts/build.env
artifacts:
reports:
# this artifact is used in trigger-simnet job
# https://docs.gitlab.com/ee/ci/multi_project_pipelines.html#with-variable-inheritance
dotenv: ./artifacts/build.env

publish-polkadot-image:
stage: build
Expand All @@ -327,6 +319,15 @@ publish-polkadot-image:
needs:
- job: test-build-linux-stable
artifacts: true
after_script:
# pass artifacts to the simnet-tests job
# https://docs.gitlab.com/ee/ci/multi_project_pipelines.html#with-variable-inheritance
- echo "PARACHAINS_IMAGE_NAME=${IMAGE_NAME}" > ./artifacts/parachains.env
- echo "PARACHAINS_IMAGE_TAG=$(cat ./artifacts/EXTRATAG)" >> ./artifacts/parachains.env
artifacts:
reports:
# this artifact is used in simnet-tests job
dotenv: ./artifacts/parachains.env

publish-adder-collator-image:
# service image for Simnet
Expand All @@ -347,11 +348,12 @@ publish-adder-collator-image:
artifacts: true
after_script:
- buildah logout "$IMAGE_NAME"
# pass artifacts to the trigger-simnet job
- echo "COLLATOR_IMAGE_TAG=$(cat ./artifacts/EXTRATAG)" > ./artifacts/collator.env
# pass artifacts to the simnet-tests job
- echo "COLLATOR_IMAGE_NAME=${IMAGE_NAME}" > ./artifacts/collator.env
- echo "COLLATOR_IMAGE_TAG=$(cat ./artifacts/EXTRATAG)" >> ./artifacts/collator.env
artifacts:
reports:
# this artifact is used in trigger-simnet job
# this artifact is used in simnet-tests job
dotenv: ./artifacts/collator.env

.update_weights: &update-weights
Expand Down Expand Up @@ -479,9 +481,9 @@ deploy-polkasync-kusama:
allow_failure: true
trigger: "parity/infrastructure/parity-testnet"

trigger-simnet:
simnet-tests:
stage: deploy
image: paritytech/tools:latest
image: "docker.io/paritytech/simnet:${SIMNET_REF}"
<<: *kubernetes-env
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
Expand All @@ -491,18 +493,26 @@ trigger-simnet:
needs:
- job: publish-polkadot-image
- job: publish-adder-collator-image
# `build.env` brings here `$IMAGE_NAME` and `$IMAGE_TAG` (`$EXTRATAG` here,
# i.e. `2643-0.8.29-5f689e0a-6b24dc54`).
# `collator.env` bears adder-collator unique build tag. In non-triggered builds it
# can be called by `master` tag.
# Simnet uses an image published on PRs with this exact version for triggered runs
# on commits. And parity/rococo:rococo-v1 for the runs not launched by this job.
variables:
TRGR_PROJECT: ${CI_PROJECT_NAME}
TRGR_REF: ${CI_COMMIT_REF_NAME}
# Simnet project ID
DWNSTRM_ID: 332
# `parachains.env` brings here `$PARACHAINS_IMAGE_NAME` and `$PARACHAINS_IMAGE_TAG`
# (`$EXTRATAG` here, # i.e. `2643-0.8.29-5f689e0a-6b24dc54`).
# `collator.env` brings here `$COLLATOR_IMAGE_NAME` and `$COLLATOR_IMAGE_TAG`
# For local tests with docker `$PARACHAINS_IMAGE_TAG` and `$COLLATOR_IMAGE_TAG`
# can be replaced with `master` tag.

# SIMNET_REF is a gitlab variable
before_script:
- echo "Simnet Tests Config
${SIMNET_IMAGE_NAME} ${SIMNET_REF}
${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}
${COLLATOR_IMAGE_NAME} ${COLLATOR_IMAGE_TAG}"
script:
# API trigger for a Simnet job, argument value is set in the project variables
- ./scripts/gitlab/trigger_pipeline.sh --simnet-version=${SIMNET_REF}
- /home/nonroot/simnet/gurke/scripts/run-test-environment-manager.sh
--github-remote-dir="https://github.com/paritytech/polkadot/tree/master/simnet_tests"
--config="simnet_tests/configs/simple_rococo_testnet.toml"
--image="${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG}"
--image-2="${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG}"
--image-simnet="docker.io/paritytech/simnet:${SIMNET_REF}"
allow_failure: true
retry: 2
tags:
- parity-simnet
202 changes: 0 additions & 202 deletions scripts/gitlab/trigger_pipeline.sh

This file was deleted.

0 comments on commit 8e47e3c

Please sign in to comment.