diff --git a/doc/source/testing.rst b/doc/source/testing.rst index 087ef5e26..88e67c83c 100644 --- a/doc/source/testing.rst +++ b/doc/source/testing.rst @@ -18,12 +18,6 @@ Install the test framework `Tox`_. $ pip install tox -Install the remaining requirements in a venv (optional). - -.. code-block:: bash - - $ pip install -r test-requirements.txt -r requirements.txt - For some tests `RuboCop`_ is required. .. code-block:: bash @@ -45,6 +39,15 @@ prior to merging or submitting a pull request. $ tox +List available scenarios +------------------------ + +List all available scenarios. This is useful to target specific Python and +Ansible version for the functional and unit tests. + + $ tox -l + + Unit ---- @@ -52,27 +55,38 @@ Run all unit tests with coverage. .. code-block:: bash - $ tox -t unit + $ tox -e 'py{27,35,36,37}-ansible{25,26,27}-unit' + +Run all unit tests for a specific version of Python and Ansible (here Python 3.7 +and Ansible 2.7). + + $ tox -e py37-ansible27-unit Functional ---------- -Run all functional tests. +Run all functional tests for all supported platforms. .. note:: - The functional tests are a work in progress. They need better structure - and reuse. + The functional tests are a work in progress. They need better structure and + reuse. They are also very slow and costly in terms of system resources. .. code-block:: bash - $ tox -t functional + $ tox -e 'py{27,35,36,37}-ansible{25,26,27}-functional' + + +Run all functional tests for a specific version of Python and Ansible (here +Python 3.7 and Ansible 2.7). + + $ tox -e py37-ansible27-functional Run all functional tests targeting the docker driver. .. code-block:: bash - $ tox -t functional -- -v -k docker + $ tox -e 'py{27,35,36,37}-ansible{25,26,27}-functional' -- -v -k docker Delegated ^^^^^^^^^ @@ -92,6 +106,16 @@ Formatting The formatting is done using `YAPF`_. +Check format +^^^^^^^^^^^^ + +.. code-block:: bash + + $ tox -e format-check + +Enforce format +^^^^^^^^^^^^^^ + .. code-block:: bash $ tox -e format @@ -106,8 +130,43 @@ Linting is performed by `Flake8`_. .. code-block:: bash - $ tox -e $(tox -l | grep lint | paste -d, -s -) + $ tox -e lint .. _`Flake8`: http://flake8.pycqa.org/en/latest/ + +Documentation +------------- + +Generate the documentation, using `sphinx`_. + +.. code-block:: bash + + $ tox -e doc + +.. _`sphinx`: http://www.sphinx-doc.org + +Metadata validation +------------------- + +Check if the long description of the generated package will render properly in +Python eggs and PyPI, using `checkdocs`_ and `twine`_. + +.. code-block:: bash + + $ tox -e metadata-validation + +.. _`checkdocs`: https://github.com/collective/collective.checkdocs + +.. _`twine`: https://twine.readthedocs.io/ + +Build docker +------------ + +Build the docker container. + +.. code-block:: bash + + $ tox -e build-docker + .. include:: ci.rst diff --git a/test-requirements.txt b/test-requirements.txt index 7bc772629..522e08093 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -11,4 +11,3 @@ shade==1.22.2 twine wheel==0.30.0 yapf>=0.25.0,<2 -tox-tags>=0.2.0 diff --git a/tox.ini b/tox.ini index 2167299b7..3e1a5580d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,5 @@ [tox] minversion = 3.7.0 -requires = tox-tags envlist = lint py{27,35,36,37}-ansible{25,26,27}-{functional,unit} @@ -51,10 +50,8 @@ sitepackages = true [testenv:lint] deps = -rlint-requirements.txt -extras = [] +extras = skip_install = true -tags = - lint usedevelop = false [testenv:format] @@ -63,17 +60,14 @@ commands = deps = yapf>=0.25.0,<2 extras = skip_install = true -tags = - format usedevelop = false + [testenv:format-check] commands = yapf -d -r molecule/ test/ deps = {[testenv:format]deps} extras = {[testenv:format]extras} skip_install = true -tags = - format usedevelop = false [testenv:doc] @@ -90,102 +84,6 @@ extras = commands= pur -r requirements.txt -[testenv:py27-ansible25-unit] -tags = - unit - -[testenv:py35-ansible25-unit] -tags = - unit - -[testenv:py36-ansible25-unit] -tags = - unit - -[testenv:py37-ansible25-unit] -tags = - unit - -[testenv:py27-ansible26-unit] -tags = - unit - -[testenv:py35-ansible26-unit] -tags = - unit - -[testenv:py36-ansible26-unit] -tags = - unit - -[testenv:py37-ansible26-unit] -tags = - unit - -[testenv:py27-ansible27-unit] -tags = - unit - -[testenv:py35-ansible27-unit] -tags = - unit - -[testenv:py36-ansible27-unit] -tags = - unit - -[testenv:py37-ansible27-unit] -tags = - unit - -[testenv:py27-ansible25-functional] -tags = - functional - -[testenv:py35-ansible25-functional] -tags = - functional - -[testenv:py36-ansible25-functional] -tags = - functional - -[testenv:py37-ansible25-functional] -tags = - functional - -[testenv:py27-ansible26-functional] -tags = - functional - -[testenv:py35-ansible26-functional] -tags = - functional - -[testenv:py36-ansible26-functional] -tags = - functional - -[testenv:py37-ansible26-functional] -tags = - functional - -[testenv:py27-ansible27-functional] -tags = - functional - -[testenv:py35-ansible27-functional] -tags = - functional - -[testenv:py36-ansible27-functional] -tags = - functional - -[testenv:py37-ansible27-functional] -tags = - functional - [testenv:metadata-validation] deps = collective.checkdocs