Skip to content

debian/test

Configure jobs to test newly built Debian binary packages (.deb).

Description

This component creates multiple jobs, each with a common prefix, that take in newly built Debian binary packages (downloaded as artifacts of other jobs in the pipeline), bundle them into a local Apt repository, and install them before executing the user-specific test commands.

Usage

include:
  - component: git.ligo.org/computing/gitlab/components/debian/test@<VERSION>
    inputs:
      test_script:
        # sanity check executable installed from Debian package
        - /usr/bin/my-script --help

Inputs

Input Default value Description
stage test The stage to add jobs to
debian_versions [bullseye, bookworm] Debian versions to test on
job_prefix debian_test Prefix to use for job name
build_prefix debian_build Job name prefix used for build jobs on which to depend
git_strategy fetch Value for GIT_STRATEGY
test_install "" Extra packages to install to support the test_script
test_script Script commands to run as part of the debian test job

Notes

debian/test jobs require matching jobs from debian/build

debian/test jobs are automatically configured with needs referencing the job from debian/build with the same debian_version value. It is required that when configuring the debian/test you also configure the debian/build component.

See Examples for examples.

Examples

Build and test a Python application on Debian

include:
  - component: git.ligo.org/computing/gitlab/components/python/sdist@0.1
    inputs:
      stage: source
  - component: git.ligo.org/computing/gitlab/components/debian/build@<VERSION>
    inputs:
      needs: [sdist]
  - component: git.ligo.org/computing/gitlab/components/debian/test@<VERSION>
    inputs:
      test_install: python3-pytest
      test_script:
        - python3 -m pytest --pyargs my_library.tests