Skip to content
Snippets Groups Projects
Commit 76de4e09 authored by Edmund Smith's avatar Edmund Smith Committed by Sjoerd Simons
Browse files

Use the new generate-test-pipeline tool

These changes are made to demonstrate to client repository owners how
to use the new tool for best effect. The tests from this repository
are not now run as standard, and the base configuration cannot be run
because the Apertis build ids are unset. Leaving the tests in an
obsolete state seems actively harmful; the alternative is simply to
remove the testing infrastructure entirely, but that makes it more
difficult to find a fully worked example of how all the tools this
repo provides fit together.

Up until now, the approach has been to run two commands back-to-back:
first generate the tests (as YAML), then submit them to Lava with
lava-submit.py. Using the new generate-test-pipeline.py tool, we
generate a pipeline which will run all the generated test files. We
can then define a new trigger job for every existing submit job to
execute the generated pipeline.
parent 30c3e29e
No related branches found
No related tags found
1 merge request!472Port apertis-test-cases to use the updated lava-runner
stages:
- build
- test
- deploy
- lava
variables:
osname: apertis
release: v2023dev3
......@@ -78,7 +84,6 @@ render-pages:
base_url: https://images.apertis.org
image_path: weekly/v2023dev3
image_buildid: "fakebuildid"
submit_extra_args: --dry-run
.submit-tests-ostree:
extends: .submit-tests
......@@ -94,7 +99,17 @@ render-pages:
base_url: https://images.apertis.org
image_path: weekly/v2023dev3
image_buildid: "fakebuildid"
submit_extra_args: --dry-run
.run-tests:
stage: lava
rules:
- if: '$CI_MERGE_REQUEST_ID'
when: never
- if: '$LAVA_URL == null'
when: never
- if: '$LAVA_TOKEN == null'
when: never
- when: on_success
submit-tests-apt-amd64-fixedfunction-uefi:
extends:
......@@ -102,47 +117,110 @@ submit-tests-apt-amd64-fixedfunction-uefi:
- .amd64-uefi
- .fixedfunction
run-tests-apt-amd64-fixedfunction-uefi:
extends: .run-tests
trigger:
strategy: depend
include:
- job: submit-tests-apt-amd64-fixedfunction-uefi
artifact: child-pipeline.yaml
submit-tests-apt-armhf-fixedfunction-uboot:
extends:
- .submit-tests-apt
- .armhf-uboot
- .fixedfunction
run-tests-apt-armhf-fixedfunction-uboot:
extends: .run-tests
trigger:
strategy: depend
include:
- job: submit-tests-apt-armhf-fixedfunction-uboot
artifact: child-pipeline.yaml
submit-tests-apt-arm64-fixedfunction-uboot:
extends:
- .submit-tests-apt
- .arm64-uboot
- .fixedfunction
run-tests-apt-arm64-fixedfunction-uboot:
extends: .run-tests
trigger:
strategy: depend
include:
- job: submit-tests-apt-arm64-fixedfunction-uboot
artifact: child-pipeline.yaml
submit-tests-apt-arm64-fixedfunction-rpi64-rpi4:
extends:
- .submit-tests-apt
- .arm64-rpi64
- .fixedfunction
run-tests-apt-arm64-fixedfunction-rpi64-rpi4:
extends: .run-tests
trigger:
strategy: depend
include:
- job: submit-tests-apt-arm64-fixedfunction-rpi64-rpi4
artifact: child-pipeline.yaml
submit-tests-apt-amd64-hmi-uefi:
extends:
- .submit-tests-apt
- .amd64-uefi
- .hmi
run-tests-apt-amd64-hmi-uefi:
extends: .run-tests
trigger:
strategy: depend
include:
- job: submit-tests-apt-amd64-hmi-uefi
artifact: child-pipeline.yaml
submit-tests-apt-armhf-hmi-uboot:
extends:
- .submit-tests-apt
- .armhf-uboot
- .hmi
run-tests-apt-armhf-hmi-uboot:
extends: .run-tests
trigger:
strategy: depend
include:
- job: submit-tests-apt-armhf-hmi-uboot
artifact: child-pipeline.yaml
submit-tests-apt-amd64-basesdk-sdk:
extends:
- .submit-tests-apt
- .amd64-sdk
- .basesdk
run-tests-apt-amd64-basesdk-sdk:
extends: .run-tests
trigger:
strategy: depend
include:
- job: submit-tests-apt-amd64-basesdk-sdk
artifact: child-pipeline.yaml
submit-tests-apt-amd64-sdk-sdk:
extends:
- .submit-tests-apt
- .amd64-sdk
- .sdk
run-tests-apt-amd64-sdk-sdk:
extends: .run-tests
trigger:
strategy: depend
include:
- job: submit-tests-apt-amd64-sdk-sdk
artifact: child-pipeline.yaml
submit-tests-ostree-amd64-fixedfunction-uefi:
extends:
......@@ -150,18 +228,42 @@ submit-tests-ostree-amd64-fixedfunction-uefi:
- .amd64-uefi
- .fixedfunction
run-tests-ostree-amd64-fixedfunction-uefi:
extends: .run-tests
trigger:
strategy: depend
include:
- job: submit-tests-ostree-amd64-fixedfunction-uefi
artifact: child-pipeline.yaml
submit-tests-ostree-armhf-fixedfunction-uboot:
extends:
- .submit-tests-ostree
- .armhf-uboot
- .fixedfunction
run-tests-ostree-armhf-fixedfunction-uboot:
extends: .run-tests
trigger:
strategy: depend
include:
- job: submit-tests-ostree-armhf-fixedfunction-uboot
artifact: child-pipeline.yaml
submit-tests-ostree-arm64-fixedfunction-uboot:
extends:
- .submit-tests-ostree
- .arm64-uboot
- .fixedfunction
run-tests-ostree-arm64-fixedfunction-uboot:
extends: .run-tests
trigger:
strategy: depend
include:
- job: submit-tests-ostree-arm64-fixedfunction-uboot
artifact: child-pipeline.yaml
submit-tests-ostree-arm64-fixedfunction-rpi64-rpi4:
extends:
- .submit-tests-ostree
......@@ -170,12 +272,28 @@ submit-tests-ostree-arm64-fixedfunction-rpi64-rpi4:
variables:
image_bundle: ${osname}_ostree_${release}-${type}-${architecture}-uboot
run-tests-ostree-arm64-fixedfunction-rpi64-rpi4:
extends: .run-tests
trigger:
strategy: depend
include:
- job: submit-tests-ostree-arm64-fixedfunction-rpi64-rpi4
artifact: child-pipeline.yaml
submit-tests-ostree-amd64-hmi-uefi:
extends:
- .submit-tests-ostree
- .amd64-uefi
- .hmi
run-tests-ostree-amd64-hmi-uefi:
extends: .run-tests
trigger:
strategy: depend
include:
- job: submit-tests-ostree-amd64-hmi-uefi
artifact: child-pipeline.yaml
submit-tests-ostree-arm64-hmi-rpi64-rpi4:
extends:
- .submit-tests-ostree
......@@ -183,3 +301,11 @@ submit-tests-ostree-arm64-hmi-rpi64-rpi4:
- .hmi
variables:
image_bundle: ${osname}_ostree_${release}-${type}-${architecture}-uboot
run-tests-ostree-arm64-hmi-rpi64-rpi4:
extends: .run-tests
trigger:
strategy: depend
include:
- job: submit-tests-ostree-arm64-hmi-rpi64-rpi4
artifact: child-pipeline.yaml
......@@ -21,7 +21,6 @@
# failures, and that in general the results should not impact the overall
# health of the project
source_wip: "true"
submit_extra_args: ""
script:
- env --null | sort -z | tr '\0' '\n'
- ./generate-jobs.py
......@@ -46,17 +45,25 @@
-t "source_wip:${source_wip}"
--verbose
--metadata-file metadata.json
- ./lava-submit.py
--jobid-file jobids.json
--metadata-file metadata.json
--callback-secret "${QA_REPORT_TOKEN}"
--callback-url https://lavaphabbridge.apertis.org/
-c ${LQA_CONFIG} submit
$submit_extra_args
./job-${osname}*.yaml
- ./generate-test-pipeline.py
--include .gitlab-ci/test-pipeline-base.yml
--output child-pipeline.yaml
--parent-pipeline $CI_PIPELINE_ID
--current-job-name $CI_JOB_NAME
--test-job-base '.test-job-base'
job-${image_name}-*.yaml
artifacts:
paths:
- ./job-${osname}*.yaml
- ./metadata.json
- ./child-pipeline.yaml
expire_in: 1 day
rules:
- if: '$CI_MERGE_REQUEST_ID'
when: never
- if: '$LQA_CONFIG == null'
- if: '$LAVA_URL == null'
when: never
- if: '$LAVA_TOKEN == null'
when: never
- when: on_success
.test-job-base:
stage: deploy
tags:
- lava-runner
artifacts:
when: always
paths:
- log.yaml
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment