From be004fe29b2ac8925adb6046969d845dac5d00fb Mon Sep 17 00:00:00 2001 From: Nikolay Markov Date: Mon, 18 Aug 2014 13:00:56 +0400 Subject: [PATCH] Added documentation on tox usage Closes-Bug: #1337283 Closes-Bug: #1331474 Change-Id: Ic21b7612c9adbffceb864ea70ea0ffb20e5cf18b --- docs/develop/nailgun/development/env.rst | 29 ++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/docs/develop/nailgun/development/env.rst b/docs/develop/nailgun/development/env.rst index c2dbbd79a6..9f0d30b48e 100644 --- a/docs/develop/nailgun/development/env.rst +++ b/docs/develop/nailgun/development/env.rst @@ -5,8 +5,8 @@ For information on how to get source code see :ref:`getting-source`. .. _nailgun_dependencies: -Setup for Nailgun Unit Tests ----------------------------- +Preparing Development Environment +--------------------------------- .. warning:: Nailgun requires Python 2.6. Please check installed Python version using ``python --version``. If the version check does not match, you can use @@ -45,6 +45,19 @@ Setup for Nailgun Unit Tests sudo mkdir /var/log/nailgun sudo chown -R `whoami`.`whoami` /var/log/nailgun + +Setup for Nailgun Unit Tests +---------------------------- + +#. Nailgun unit tests use `Tox `_ for generating test + environments. This means that you don't need to install all Python packages required + for the project to run them, because Tox does this by itself. + +#. First, create a virtualenv the way it's described in previous section. Then, install + the Tox package:: + + pip install tox + #. Run the Nailgun backend unit tests:: ./run_tests.sh --no-jslint --no-webui @@ -53,6 +66,18 @@ Setup for Nailgun Unit Tests ./run_tests.sh --flake8 +#. You can also run the same tests by hand, using tox itself:: + + cd nailgun + tox -epy26 -- -vv nailgun/test + tox -epep8 + +#. Tox reuses the previously created environment. After making some changes with package + dependencies, tox should be run with **-r** option to recreate existing virtualenvs:: + + tox -r -epy26 -- -vv nailgun/test + tox -r -epep8 + Setup for Web UI Tests ----------------------