1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. SPDX-License-Identifier: CC-BY-4.0
11 NFVbench project uses `tox`_ to orchestrate the testing of the code base:
16 * check links in the docs
18 In addition to testing, tox is also used to generate the documentation in HTML
21 What tox should do is specified in a ``tox.ini`` file located at the project root.
23 tox is used in continuous integration (jenkins-ci today, gitlab-ci in the near
24 future): all the actions performed by tox must succeed before a patchset can be
25 merged. As a developer, it is also useful to run tox locally to detect and fix
26 the issues before pushing the code for review.
28 .. _tox: https://tox.wiki/en/latest/
32 Using tox on a developer's machine
33 ==================================
35 Requirement: |python-version|
36 -----------------------------
38 .. |python-version| replace:: Python 3.6
40 The current version of Python used by NFVbench is |python-version|. In
41 particular, this means that |python-version| is used:
44 * in nfvbench Docker image
45 * in nfvbench traffic generator VM image
47 |python-version| is needed to be able to run tox locally. If it is not
48 available through the package manager, it can be installed using `pyenv`_. In
49 that case, it will also be necessary to install the `pyenv-virtualenv`_ plugin.
50 Refer to the documentation of those projects for installation instructions.
52 .. _pyenv: https://github.com/pyenv/pyenv
53 .. _pyenv-virtualenv: https://github.com/pyenv/pyenv-virtualenv
61 $ pip install tox tox-pip-version
67 In nfvbench root directory, simply run tox with::
71 If all goes well, tox shows a green summary such as::
73 py36: commands succeeded
74 pep8: commands succeeded
75 lint: commands succeeded
76 docs: commands succeeded
77 docs-linkcheck: commands succeeded
80 It is possible to run only a subset of tox *environments* with the ``-e``
81 command line option. For instance, to check the code style only, do::
85 Each tox *environment* uses a dedicated python virtual environment. The
86 ``-r`` command line option can be used to force the recreation of the virtual
87 environment(s). For instance::