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: all the actions performed by tox must
24 succeed before a patchset can be merged. As a developer, it is also useful to
25 run tox locally to detect and fix the issues before pushing the code for review.
27 .. _tox: https://tox.wiki/en/latest/
31 Using tox on a developer's machine
32 ==================================
34 Requirement: |python-version|
35 -----------------------------
37 .. |python-version| replace:: Python 3.8
39 The current version of Python used by NFVbench is |python-version|. In
40 particular, this means that |python-version| is used:
43 * in nfvbench Docker image
44 * in nfvbench traffic generator VM image
46 |python-version| is needed to be able to run tox locally. If it is not
47 available through the package manager, it can be installed using `pyenv`_. In
48 that case, it will also be necessary to install the `pyenv-virtualenv`_ plugin.
49 Refer to the documentation of those projects for installation instructions.
51 .. _pyenv: https://github.com/pyenv/pyenv
52 .. _pyenv-virtualenv: https://github.com/pyenv/pyenv-virtualenv
60 $ pip install tox==3.21.4
62 .. note:: tox 3.21.4 is the version that comes with Ubuntu 22.04 and that can be
63 found on gerrit.opnfv.org build servers.
69 In nfvbench root directory, simply run tox with::
73 If all goes well, tox shows a green summary such as::
75 py38: commands succeeded
76 pep8: commands succeeded
77 lint: commands succeeded
78 docs: commands succeeded
79 docs-linkcheck: commands succeeded
82 It is possible to run only a subset of tox *environments* with the ``-e``
83 command line option. For instance, to check the code style only, do::
87 Each tox *environment* uses a dedicated python virtual environment. The
88 ``-r`` command line option can be used to force the recreation of the virtual
89 environment(s). For instance::