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

fix #1885 #1764 - remove tox-tags #1886

Merged
merged 2 commits into from
Mar 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 72 additions & 13 deletions doc/source/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -45,34 +39,54 @@ prior to merging or submitting a pull request.

themr0c marked this conversation as resolved.
Show resolved Hide resolved
$ 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
----

Run all unit tests with coverage.

.. code-block:: bash

$ tox -t unit
$ tox -e 'py{27,35,36,37}-ansible{25,26,27}-unit'
webknjaz marked this conversation as resolved.
Show resolved Hide resolved
webknjaz marked this conversation as resolved.
Show resolved Hide resolved

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
^^^^^^^^^
Expand All @@ -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
Expand All @@ -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
1 change: 0 additions & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ shade==1.22.2
twine
wheel==0.30.0
yapf>=0.25.0,<2
tox-tags>=0.2.0
106 changes: 2 additions & 104 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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}
Expand Down Expand Up @@ -51,10 +50,8 @@ sitepackages = true
[testenv:lint]
deps =
-rlint-requirements.txt
extras = []
extras =
skip_install = true
tags =
lint
usedevelop = false

[testenv:format]
Expand All @@ -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]
Expand All @@ -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
Expand Down