Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: refresh testing_integration.rst #53338

Merged
merged 8 commits into from
Mar 8, 2019
45 changes: 33 additions & 12 deletions docs/docsite/rst/dev_guide/testing_integration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,32 @@ It provides tab completion in ``bash`` for the ``ansible-test`` test runner.
Configuration
=============

ansible-test command
--------------------

The example below assumes ``bin/`` is in your ``$PATH``. An easy way to achieve that
is to initialize your environment with the ``env-setup`` command::

source hacking/env-setup
ansible-test --help

You can also call ``ansible-test`` with the full path::

bin/ansible-test --help

integration_config.yml
----------------------

mattclay marked this conversation as resolved.
Show resolved Hide resolved
Making your own version of ``integration_config.yml`` can allow for setting some
tunable parameters to help run the tests better in your environment. Some
tests (e.g. cloud) will only run when access credentials are provided. For
more information about supported credentials, refer to ``credentials.template``.
tests (e.g. cloud) will only run when access credentials are provided. For more
information about supported credentials, refer to the various ``cloud-config-*.template``
files in the ``test/integration/`` directory.

Prerequisites
=============

The tests will assume things like hg, svn, and git are installed and in path. Some tests
Some tests assume things like hg, svn, and git are installed, and in path. Some tests
(such as those for Amazon Web Services) need separate definitions, which will be covered
later in this document.

Expand All @@ -55,23 +72,27 @@ outside of those test subdirectories. They will also not reconfigure or bounce

Run as follows for all POSIX platform tests executed by our CI system::

test/runner/ansible-test integration --docker fedora25 -v posix/ci/
ansible-test integration --docker fedora29 -v shippable/
goneri marked this conversation as resolved.
Show resolved Hide resolved

You can target a specific tests as well, such as for individual modules::

ansible-test integration -v ping

You can select specific tests as well, such as for individual modules::
Use the following command to list all the available targets::

test/runner/ansible-test integration -v ping
ansible-test integration --list-targets

By installing ``argcomplete`` you can obtain a full list by doing::
.. note:: Bash users

test/runner/ansible-test integration <tab><tab>
If you use ``bash`` with ``argcomplete``, obtain a full list by doing: ``ansible-test integration <tab><tab>``

Destructive Tests
=================

These tests are allowed to install and remove some trivial packages. You will likely want to devote these
to a virtual environment, such as Docker. They won't reformat your filesystem::

test/runner/ansible-test integration --docker fedora25 -v destructive/
ansible-test integration --docker fedora29 -v destructive/

Windows Tests
=============
Expand All @@ -94,7 +115,7 @@ Define Windows inventory::

Run the Windows tests executed by our CI system::

test/runner/ansible-test windows-integration -v windows/ci/
ansible-test windows-integration -v shippable/

Tests in Docker containers
==========================
Expand All @@ -113,12 +134,12 @@ Running Integration Tests

To run all CI integration test targets for POSIX platforms in a Ubuntu 16.04 container::

test/runner/ansible-test integration -v posix/ci/ --docker
ansible-test integration --docker ubuntu1604 -v shippable/

You can also run specific tests or select a different Linux distribution.
For example, to run tests for the ``ping`` module on a Ubuntu 14.04 container::

test/runner/ansible-test integration -v ping --docker ubuntu1404
ansible-test integration -v ping --docker ubuntu1404

Container Images
----------------
Expand Down