From 176a99f022269018a69c4ea0563c99c7f0ff0977 Mon Sep 17 00:00:00 2001 From: Filip Valder Date: Tue, 23 May 2017 11:34:05 +0200 Subject: [PATCH] Fix #324: Add 'Running Tests' section --- docs/CONTRIBUTING.rst | 50 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/docs/CONTRIBUTING.rst b/docs/CONTRIBUTING.rst index 328d1874..dcf55150 100644 --- a/docs/CONTRIBUTING.rst +++ b/docs/CONTRIBUTING.rst @@ -1,6 +1,54 @@ +Running Tests +============= + +The proper way how to run unit tests is using `tox +`_. See `tox.ini` configuration file in the +topmost directory of the project's repository. + +For most cases, you need to work against tox's `py27` environment. This +will just invoke `pytest` command. For full set of tests, omit the `-e +py27` argument. This will invoke code analysis, security analysis and +code coverage checks. And any other environments which will appear in the +`tox.ini` file in the future. + +Examples +-------- + +Purge environment (this will remove all untracked files/dirs and +uncommited changes!) and run tests:: + + $ git clean -fdxe '/.vagrant' + $ tox -e py27 + +Just recreate tox's `py27` environment and run the tests:: + + $ tox -e py27 -r + +Just rerun tests in the existing `py27` enviromnent:: + + $ tox -e py27 + +Pass additional arg(s) to `pytest`, e.g. `-x` to exit on first +error/failed test:: + + $ tox -e py27 -- -x + +Run only tests in the given file or directory:: + + $ tox -e py27 -- path/to/test_file.py/or/test_dir + +For more `tox` or `pytest` options, see the corresponding help/man pages. + +*Note: Consider using detox which makes efficient use of multiple CPUs +by running all possible activities in parallel. It has the same options +and configuration that tox has.* + Development =========== +In most cases, you don't need to deploy your development instance. Please, +refer to `Running Tests` section first. + We have two mechanisms for quickly setting up a development environment, `docker-compose` and `vagrant`. @@ -186,7 +234,7 @@ Then uncomment the fedmsg signing configuration in `fedmsg.d/module_build_service.py`. Historical Names of Module Build Service ----------------------------------------- +======================================== - Rida - The Orchestrator