Skip to content

Commit 85d881b

Browse files
authored
Add quick simnet tests to .gitlab-ci.yml (paritytech#9959)
* 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
1 parent 582db90 commit 85d881b

File tree

2 files changed

+66
-4
lines changed

2 files changed

+66
-4
lines changed

.gitlab-ci.yml

Lines changed: 65 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ variables: &default-vars
4545
VAULT_SERVER_URL: "https://vault.parity-mgmt-vault.parity.io"
4646
VAULT_AUTH_PATH: "gitlab-parity-io-jwt"
4747
VAULT_AUTH_ROLE: "cicd_gitlab_parity_${CI_PROJECT_NAME}"
48+
SIMNET_FEATURES_PATH: "simnet_tests/tests"
4849

4950
default:
5051
cache: {}
@@ -57,6 +58,14 @@ default:
5758
paths:
5859
- artifacts/
5960

61+
.collect-artifacts-short: &collect-artifacts-short
62+
artifacts:
63+
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
64+
when: on_success
65+
expire_in: 3 hours
66+
paths:
67+
- artifacts/
68+
6069
.kubernetes-env: &kubernetes-env
6170
retry:
6271
max: 2
@@ -188,13 +197,13 @@ default:
188197
file: false
189198
AWX_TOKEN:
190199
vault: cicd/gitlab/$CI_PROJECT_PATH/AWX_TOKEN@kv
191-
file: false
200+
file: false
192201
CRATES_TOKEN:
193202
vault: cicd/gitlab/$CI_PROJECT_PATH/CRATES_TOKEN@kv
194203
file: false
195204
DOCKER_CHAOS_TOKEN:
196205
vault: cicd/gitlab/$CI_PROJECT_PATH/DOCKER_CHAOS_TOKEN@kv
197-
file: false
206+
file: false
198207
DOCKER_CHAOS_USER:
199208
vault: cicd/gitlab/$CI_PROJECT_PATH/DOCKER_CHAOS_USER@kv
200209
file: false
@@ -580,6 +589,12 @@ build-linux-substrate: &build-binary
580589
- cp -r .maintain/docker/substrate.Dockerfile ./artifacts/substrate/
581590
- sccache -s
582591

592+
#Build binary for simnet quick tests.
593+
build-linux-substrate-simnet:
594+
<<: *build-binary
595+
<<: *collect-artifacts-short
596+
<<: *test-refs-no-trigger-prs-only
597+
583598
build-linux-subkey: &build-subkey
584599
stage: build
585600
<<: *collect-artifacts
@@ -689,6 +704,25 @@ publish-docker-substrate:
689704
# https://docs.gitlab.com/ee/ci/multi_project_pipelines.html#with-variable-inheritance
690705
dotenv: ./artifacts/substrate/build.env
691706

707+
#publish artifact for quick simnet tests
708+
publish-docker-substrate-simnet:
709+
stage: publish
710+
<<: *build-push-docker-image
711+
<<: *test-refs-no-trigger-prs-only
712+
needs:
713+
- job: build-linux-substrate-simnet
714+
artifacts: true
715+
variables:
716+
<<: *default-vars
717+
GIT_STRATEGY: none
718+
DOCKERFILE: $PRODUCT.Dockerfile
719+
PRODUCT: substrate
720+
IMAGE_NAME: docker.io/paritypr/$PRODUCT
721+
artifacts:
722+
reports:
723+
# this artifact is used in simnet-tests-quick job
724+
dotenv: ./artifacts/substrate/build.env
725+
692726
publish-docker-subkey:
693727
stage: publish
694728
<<: *build-push-docker-image
@@ -871,12 +905,39 @@ simnet-tests:
871905
before_script:
872906
- echo "Simnet Tests Config
873907
docker.io/paritytech/simnet:${SIMNET_REF}
874-
${SUBSTRATE_IMAGE_NAME} ${SUBSTRATE_IAMGE_TAG}"
908+
${SUBSTRATE_IMAGE_NAME} ${SUBSTRATE_IMAGE_TAG}"
875909
script:
876910
- /home/nonroot/simnet/gurke/scripts/run-test-environment-manager.sh
877911
--github-remote-dir="https://github.com/paritytech/substrate/tree/master/simnet_tests"
878912
--config="simnet_tests/configs/default_local_testnet.toml"
879913
--image="${SUBSTRATE_IMAGE_NAME}:${SUBSTRATE_IMAGE_TAG}"
880914
retry: 2
881915
tags:
882-
- parity-simnet
916+
- substrate-simnet
917+
918+
#run quick simnet-tests for each PR
919+
simnet-tests-quick:
920+
stage: deploy
921+
image: docker.io/paritytech/simnet:${SIMNET_REF}
922+
<<: *kubernetes-env
923+
<<: *vault-secrets
924+
<<: *test-refs-no-trigger-prs-only
925+
variables:
926+
SIMNET_FEATURES: "${SIMNET_FEATURES_PATH}/quick"
927+
needs:
928+
- job: publish-docker-substrate-simnet
929+
before_script:
930+
- echo "Simnet Tests Config
931+
docker.io/paritytech/simnet:${SIMNET_REF}
932+
${SUBSTRATE_IMAGE_NAME} ${SUBSTRATE_IMAGE_TAG}"
933+
script:
934+
- echo "Image=${SUBSTRATE_IMAGE_NAME}:${SUBSTRATE_IMAGE_TAG}"
935+
- echo "Features=${SIMNET_FEATURES}"
936+
- /home/nonroot/simnet/gurke/scripts/run-test-environment-manager.sh
937+
--github-remote-dir="https://github.com/paritytech/substrate/tree/master/simnet_tests"
938+
--config="simnet_tests/configs/default_local_testnet.toml"
939+
--image="${SUBSTRATE_IMAGE_NAME}:${SUBSTRATE_IMAGE_TAG}"
940+
--features="${SIMNET_FEATURES}"
941+
tags:
942+
- substrate-simnet
943+

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ The security policy and procedures can be found in [`docs/SECURITY.md`](docs/SEC
2828
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.
2929

3030
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.
31+

0 commit comments

Comments
 (0)