diff options
author | Daniel Watkins <oddbloke@ubuntu.com> | 2020-12-03 13:17:55 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-03 13:17:55 -0500 |
commit | 6c4e87bf336073183f8ae8964366d574c7ee4823 (patch) | |
tree | 23cf3538e08f86986ef9a363b525c1f9b96a84aa /doc | |
parent | ed9bd19ca88e4c6458c95d26151c734112615e9a (diff) | |
download | vyos-cloud-init-6c4e87bf336073183f8ae8964366d574c7ee4823.tar.gz vyos-cloud-init-6c4e87bf336073183f8ae8964366d574c7ee4823.zip |
integration_tests: introduce skipping of tests by OS (#702)
This introduces an optional, more complex OS_IMAGE format (`<image
id>::<os>::<release>`) which allows the specification of the OS/OS
release which the given image ID corresponds to. This information is
used to skip tests which do not apply to the image.
This commit is comprised of the following discrete changes:
* introduce the IntegrationImage class, to handle parsing and storing
the new OS_IMAGE format
* support inferring the OS and OS release of Ubuntu series, so that we
can continue to set OS_IMAGE to just a series name and have test
skipping work
* add documentation on Image Selection to integration_tests.rst
* introduce the actual skipping behaviour based on OS marks
* apply the `ubuntu` mark to all tests that should be skipped on
non-Ubuntu operating systems
Diffstat (limited to 'doc')
-rw-r--r-- | doc/rtd/topics/integration_tests.rst | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/doc/rtd/topics/integration_tests.rst b/doc/rtd/topics/integration_tests.rst index aeda326c..3cfca31e 100644 --- a/doc/rtd/topics/integration_tests.rst +++ b/doc/rtd/topics/integration_tests.rst @@ -14,6 +14,36 @@ laid out in :ref:`unit_testing` should be followed for integration tests. Setup is accomplished via a set of fixtures located in ``tests/integration_tests/conftest.py``. +Image Selection +=============== + +Each integration testing run uses a single image as its basis. This +image is configured using the ``OS_IMAGE`` variable; see +:ref:`Configuration` for details of how configuration works. + +``OS_IMAGE`` can take two types of value: an Ubuntu series name (e.g. +"focal"), or an image specification. If an Ubuntu series name is +given, then the most recent image for that series on the target cloud +will be used. For other use cases, an image specification is used. + +In its simplest form, an image specification can simply be a cloud's +image ID (e.g. "ami-deadbeef", "ubuntu:focal"). In this case, the +image so-identified will be used as the basis for this testing run. + +This has a drawback, however: as we do not know what OS or release is +within the image, the integration testing framework will run *all* +tests against the image in question. If it's a RHEL8 image, then we +would expect Ubuntu-specific tests to fail (and vice versa). + +To address this, a full image specification can be given. This is of +the form: ``<image_id>[::<os>[::<release]]`` where ``image_id`` is a +cloud's image ID, ``os`` is the OS name, and ``release`` is the OS +release name. So, for example, Ubuntu 18.04 (Bionic Beaver) on LXD is +``ubuntu:bionic::ubuntu::bionic`` or RHEL 8 on Amazon is +``ami-justanexample::rhel::8``. When a full specification is given, +only tests which are intended for use on that OS and release will be +executed. + Image Setup =========== |