Add more ansible-test aliases to test docs. (#50921)

pull/4420/head
Matt Clay 2019-01-15 13:02:43 -08:00 committed by Alicia Cozine
parent 721a28202e
commit 560e922440
1 changed files with 32 additions and 1 deletions

View File

@ -25,6 +25,14 @@ They also improve efficiency by keeping tests with similar requirements running
When selecting a group for a new test, use the same group as existing tests similar to the one being added. When selecting a group for a new test, use the same group as existing tests similar to the one being added.
If more than one group is available, select one randomly. If more than one group is available, select one randomly.
Setup
-----
Aliases can be used to execute setup targets before running tests:
- ``setup/once/TARGET`` - Run the target ``TARGET`` before the first target that requires it.
- ``setup/always/TARGET`` - Run the target ``TARGET`` before each target that requires it.
Requirements Requirements
------------ ------------
@ -33,6 +41,21 @@ Aliases can be used to express some test requirements:
- ``needs/privileged`` - Requires ``--docker-privileged`` when running tests with ``--docker``. - ``needs/privileged`` - Requires ``--docker-privileged`` when running tests with ``--docker``.
- ``needs/root`` - Requires running tests as ``root`` or with ``--docker``. - ``needs/root`` - Requires running tests as ``root`` or with ``--docker``.
- ``needs/ssh`` - Requires SSH connections to localhost (or the test container with ``--docker``) without a password. - ``needs/ssh`` - Requires SSH connections to localhost (or the test container with ``--docker``) without a password.
- ``needs/httptester`` - Requires use of the http-test-container to run tests.
Dependencies
------------
Some test dependencies are automatically discovered:
- Ansible role dependencies defined in ``meta/main.yml`` files.
- Setup targets defined with ``setup/*`` aliases.
- Symbolic links from one target to a file in another target.
Aliases can be used to declare dependencies that are not handled automatically:
- ``needs/target/TARGET`` - Requires use of the test target ``TARGET``.
- ``needs/file/PATH`` - Requires use of the file ``PATH`` relative to the git root.
Skipping Skipping
-------- --------
@ -42,7 +65,7 @@ Aliases can be used to skip platforms using one of the following:
- ``skip/freebsd`` - Skip tests on FreeBSD. - ``skip/freebsd`` - Skip tests on FreeBSD.
- ``skip/osx`` - Skip tests on macOS. - ``skip/osx`` - Skip tests on macOS.
- ``skip/rhel`` - Skip tests on RHEL. - ``skip/rhel`` - Skip tests on RHEL.
- ``skip/docker`` - Skip tests when running on a Docker container - ``skip/docker`` - Skip tests when running in a Docker container.
Platform versions, as specified using the ``--remote`` option with ``/`` removed, can also be skipped: Platform versions, as specified using the ``--remote`` option with ``/`` removed, can also be skipped:
@ -61,6 +84,14 @@ For more fine grained skipping, use conditionals in integration test playbooks,
when: ansible_distribution in ('Ubuntu') when: ansible_distribution in ('Ubuntu')
Miscellaneous
-------------
There are several other aliases available as well:
- ``destructive`` - Requires ``--allow-destructive`` to run without ``--docker`` or ``--remote``.
- ``hidden`` - Target is ignored. Usable as a dependency. Automatic for ``setup_`` and ``prepare_`` prefixed targets.
Unstable Unstable
-------- --------