adding .coveragerc and docs about how to use it

This commit is contained in:
Peter Bengtsson 2018-09-14 15:17:17 -04:00
Родитель 5156fac1e3
Коммит 2d0ef9fd65
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: EEDB25B3B0643BFB
3 изменённых файлов: 49 добавлений и 0 удалений

13
.coveragerc Normal file
Просмотреть файл

@ -0,0 +1,13 @@
[run]
source = normandy
branch = True
data_file = /tmp/.coverage
[report]
omit =
tests/*
normandy/settings.py
normandy/wsgi.py
[xml]
output = /tmp/coverage.xml

35
docs/dev/coverage.rst Normal file
Просмотреть файл

@ -0,0 +1,35 @@
=============
Test Coverage
=============
We do not include test coverage as a metric or a requirement in CI but test coverage as a
local tool is useful to make sure your code does test all the things you care about.
To use it, install ``coverage`` in your virtualenv env.
.. code-block:: bash
pip install coverage
Now run the tests with coverage like this:
.. code-block:: bash
coverage run -m pytest normandy
To generate a report, run:
.. code-block:: bash
coverage html --skip-covered
This will create the HTML report in the ``./htmlcov/`` directory.
.. code-block:: bash
open htmlcov/index.html
.. note::
The ``--skip-covered`` flag means it doesn't create a HTML report for files with 100%
test coverage.

Просмотреть файл

@ -14,6 +14,7 @@ of the Normandy client.
workflow
api-tests
code-style
coverage
feature-experiments
troubleshooting
ci