+

Search Tips   |   Advanced Search

Compile Tests

Topics


Overview

Compile tests check source files for valid syntax on all supported python versions:

NOTE: In Ansible 2.4 and earlier the compile test was provided by a dedicated sub-command ansible-test compile instead of a sanity test using ansible-test sanity --test compile.


Running compile tests locally

Compile tests can be run across the whole code base by doing:

Against a single file by doing:

Or against a specific Python version by doing:

For advanced usage see the help:


Installing dependencies

ansible-test has a number of dependencies , for compile tests we suggest running the tests with --local, which is the default

The dependencies can be installed using the --requirements argument. For example:

The full list of requirements can be found at test/lib/ansible_test/_data/requirements. Requirements files are named after their respective commands. See also the constraints applicable to all commands.


Extending compile tests

If you believe changes are needed to the compile tests please add a comment on the Testing Working Group Agenda so it can be discussed.