diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..531da9db --- /dev/null +++ b/.coveragerc @@ -0,0 +1,8 @@ +[run] +source = mistralclient +omit = + .tox/* + mistralclient/tests/* + +[report] +ignore_errors = True diff --git a/.zuul.yaml b/.zuul.yaml index 886a902c..03fc8eeb 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -35,6 +35,13 @@ - release-notes-jobs-python3 check: jobs: + - openstack-tox-cover: + voting: false + irrelevant-files: + - ^.zuul.yaml$ + - ^.*\.rst$ + - ^doc/.*$ + - ^releasenotes/.*$ - python-mistralclient-functional-devstack # TripleO jobs that deploy Mistral. # Note we don't use a project-template here, so it's easier diff --git a/lower-constraints.txt b/lower-constraints.txt index d07b7cb9..8c0d6932 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -8,6 +8,7 @@ cffi==1.7.0 cliff==2.8.0 cmd2==0.8.0 contextlib2==0.4.0 +coverage==4.0 cryptography==2.1 debtcollector==1.2.0 decorator==3.4.0 diff --git a/mistralclient/tests/unit/test_httpclient.py b/mistralclient/tests/unit/test_httpclient.py index 297ccb6f..2b9696eb 100644 --- a/mistralclient/tests/unit/test_httpclient.py +++ b/mistralclient/tests/unit/test_httpclient.py @@ -59,7 +59,6 @@ class HTTPClientTest(base.BaseClientTest): def setUp(self): super(HTTPClientTest, self).setUp() - osprofiler.profiler.init(None) self.client = httpclient.HTTPClient( API_BASE_URL, auth_token=AUTH_TOKEN, diff --git a/test-requirements.txt b/test-requirements.txt index 7deb3e3c..698c986c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,7 @@ # The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. +coverage>=4.0 # Apache-2.0 hacking>=1.1.0,<1.2.0 # Apache-2.0 python-openstackclient>=3.12.0 # Apache-2.0 mock>=2.0.0 # BSD diff --git a/tox.ini b/tox.ini index 430b6bca..03a1fb7c 100644 --- a/tox.ini +++ b/tox.ini @@ -21,6 +21,16 @@ commands = stestr run --concurrency 1 --slowest {posargs} whitelist_externals = find rm +[testenv:cover] +setenv = + {[testenv]setenv} + PYTHON=coverage run --source mistralclient --parallel-mode +commands = + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml + coverage report [testenv:functional] setenv = TEST_PATH = ./mistralclient/tests/functional