зеркало из https://github.com/mozilla/normandy.git
adding .coveragerc and docs about how to use it
This commit is contained in:
Родитель
5156fac1e3
Коммит
2d0ef9fd65
|
@ -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
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче