Add coverage report to unit test

Change-Id: I67d03632a443a1db2800eaf86108b7fc60262b1d
Signed-off-by: Zhijiang Hu <hu.zhijiang@zte.com.cn>
This commit is contained in:
Zhijiang Hu 2016-12-23 06:10:25 -05:00
parent 98b0119538
commit 4f85aca3b4
3 changed files with 88 additions and 1 deletions

76
.gitignore vendored Normal file
View File

@ -0,0 +1,76 @@
# Normal for all project
*~
.*.sw?
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*.confc
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
eggs/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
.tox/
.coverage
.cache
cover/
# Log files:
*.log
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# SublimeText
*.sublime-project
*.sublime-workspace
# macos preview
.DS_Store
# PyCharm
.idea/
# tempest
.testrepository
test/tempest/daisy.xml
# RPM
rpm/BUILD
rpm/SOURCES
rpm/RPMS
# oslo config generator
code/daisy/etc/daisy-api.conf.sample
code/daisy/etc/daisy-manage.conf.sample
code/daisy/etc/daisy-registry.conf.sample

7
code/daisy/.coveragerc Normal file
View File

@ -0,0 +1,7 @@
[run]
branch = True
source = daisy
omit = daisy/tests/*
[report]
ignore_errors = True

View File

@ -9,7 +9,11 @@ usedevelop = True
install_command = pip install -U {opts} {packages}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = python setup.py testr --slowest --testr-args='{posargs}'
commands =
coverage erase
python setup.py testr --coverage --slowest --testr-args='{posargs}'
coverage report -m
whitelist_externals = bash
[testenv:pep8]