From 6421e89e23524237a2baa352615b15bab2fb7c97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A9ri=20Le=20Bouder?= Date: Thu, 7 Mar 2019 21:43:04 -0500 Subject: [PATCH] docs: refresh testing_integration.rst (#53338) * docs: refresh testing_integration.rst Ensures the examples can be run: - fedora25 is not available anymore, use fedora29 instead - the posix/ci alias does not exist anymore, use shippable/posix/ instead - explain how to list the target without argcomplete * ansible-test should be in $PATH * call ansible-runner from bin/, not test/runner * we don't use credentials.template anymore, we use a collection of .template files. * low-case bash bc we refresh to name of the binary * refresh the command of Windows-CI example * Update docs/docsite/rst/dev_guide/testing_integration.rst Co-Authored-By: goneri --- .../rst/dev_guide/testing_integration.rst | 45 ++++++++++++++----- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/docs/docsite/rst/dev_guide/testing_integration.rst b/docs/docsite/rst/dev_guide/testing_integration.rst index 12411dc993..34ef1b9fa1 100644 --- a/docs/docsite/rst/dev_guide/testing_integration.rst +++ b/docs/docsite/rst/dev_guide/testing_integration.rst @@ -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 +---------------------- + 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. @@ -55,15 +72,19 @@ 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/ -You can select specific tests as well, such as for individual modules:: +You can target a specific tests as well, such as for individual modules:: - test/runner/ansible-test integration -v ping + ansible-test integration -v ping -By installing ``argcomplete`` you can obtain a full list by doing:: +Use the following command to list all the available targets:: - test/runner/ansible-test integration + ansible-test integration --list-targets + +.. note:: Bash users + + If you use ``bash`` with ``argcomplete``, obtain a full list by doing: ``ansible-test integration `` Destructive Tests ================= @@ -71,7 +92,7 @@ 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 ============= @@ -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 ========================== @@ -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 ----------------