Plugin CI pipeline: Add job template for running test suite
Once the test suite changes described in cms-cactus/phase2/pyswatch#3 (closed) are merged into the pyswatch master branch, we should run the test suite in the CI pipelines of plugin repositories.
Since we might want to run these tests on multiple versions of boards (e.g. Serenity Z1.1 and 1.2, or on VU9P and VU13P boards), the number of test jobs might be different in different plugin repositories, and so rather than declaring 1 or more jobs in ci/plugin-pipeline.yml
that plugin developers customize by using environment variables, I'd recommend just creating a job template named .test_fsms
that plugin developers then inherit from.
Detailed specification for test job template:
- Image: The relevant pyswatch container. Set tag of that container image from a variable,
TEST_FSM_IMAGE_TAG
, just in case people ever need to use more recent (e.g. bleeding edge) versions of pyswatch. - The HERD app + plugin image can be run as a service named
herd
- Use the same image as produced by the manfest jobs (should be
${CI_REGISTRY_IMAGE}/${BUILD_VARIANT}/herd:${IMAGE_TAG}
, whereIMAGE_TAG
is${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA}
if${CI_COMMIT_TAG}
is empty, or${CI_COMMIT_TAG}
)
- Use the same image as produced by the manfest jobs (should be
- In the script, hardcode the config file path to
test/config/algo_fsm.yml
andtest/config/link_fsm.yml
, hardcode hostname toherd
, set the main required parameters from specific env variables (e.g.HERD_PROCESSOR_ID
for--processor
andFIRMWARE_PACKAGE
for--fw-package
), and add another env variable for the rest of the arguments - The job should be a manual job - as people should claim the board on the relevant slack/mattermost/skype group before running the job.
- The job should depend on the
manifest:centos7
andmanifest:centos8
jobs- Both optional dependencies, via
needs
keyword.
- Both optional dependencies, via
- Variables used by template job:
-
BUILD_VARIANT
: Used in image name (would becentos7
orcentos8
) -
TEST_FSM_IMAGE_TAG
: Tag of pyswatch plugin FSM tester image. Default value:v0.3.8
-
HERD_PROCESSOR_ID
(should typically be set in gitlab runner config on the board, rather than in CI config) FIRMWARE_PACKAGE
-
TEST_ALGO_FSM_EXTRA_ARGUMENTS
(optional) -
TEST_LINK_FSM_EXTRA_ARGUMENTS
(optional)
-
Example of using this test job template in a plugin repository:
test:vu9p:
extends: .test_fsms
variables:
BUILD_VARIANT: centos7
FIRMWARE_PACKAGE: http://emp-fwk.web.cern.ch/emp-fwk/fw/bitfiles/v0.6.8/serenity_vu9p_so2.tgz
TEST_ALGO_FSM_EXTRA_ARGUMENTS: '...' # if needed
TEST_LINK_FSM_EXTRA_ARGUMENTS: '...' # if needed
test:vu13p:
extends: .test_fsms
variables:
BUILD_VARIANT: centos7
FIRMWARE_PACKAGE: http://emp-fwk.web.cern.ch/emp-fwk/fw/bitfiles/v0.6.8/serenity_vu13p_so2.tgz
TEST_ALGO_FSM_EXTRA_ARGUMENTS: '...' # if needed
TEST_LINK_FSM_EXTRA_ARGUMENTS: '...' # if needed
Edited by Tom Williams