From 6c70cbdbfe20fb86cd8bfe04acbdc8647da97fe4 Mon Sep 17 00:00:00 2001 From: Felipe Monteiro Date: Mon, 14 Aug 2017 19:49:38 +0100 Subject: [PATCH] Add Deckhand coverage job This commits adds a Deckhand coverage job for gauging the test coverage of Deckhand to tox.ini. Change-Id: If3cb7b31127dd5cd58c7a3f8dc87f1f7a4f74101 --- .coveragerc | 7 +++++++ .gitignore | 2 +- test-requirements.txt | 2 ++ tox.ini | 7 +++++++ 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..8a9ce0c2 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,7 @@ +[run] +branch = True +source = deckhand +omit = deckhand/tests/* + +[report] +ignore_errors = True \ No newline at end of file diff --git a/.gitignore b/.gitignore index 188f0211..dee2eb72 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,6 @@ wheels/ *.egg-info/ .installed.cfg *.egg -etc/*.sample # PyInstaller # Usually these files are written by a python script from a template @@ -47,6 +46,7 @@ coverage.xml *.cover .hypothesis/ .testrepository/* +cover/* # Translations *.mo diff --git a/test-requirements.txt b/test-requirements.txt index 5e85168c..e6663379 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,6 +7,8 @@ hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 falcon==1.1.0 +hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 +coverage!=4.4,>=4.0 # Apache-2.0 mock>=2.0 fixtures>=3.0.0 # Apache-2.0/BSD mox3!=0.19.0,>=0.7.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 462fc91f..9f409501 100644 --- a/tox.ini +++ b/tox.ini @@ -38,6 +38,13 @@ commands = find . -type f -name "*.pyc" -delete ostestr '{posargs}' +[testenv:cover] +commands = + coverage erase + find . -type f -name "*.pyc" -delete + python setup.py testr --coverage --testr-args='{posargs}' + coverage report + [testenv:genconfig] commands = oslo-config-generator --config-file=etc/deckhand/config-generator.conf