Add script for unit test coverage job
This patch will allow to run a non voting coverage job which will detect any changes in the code coverage for each commit on review. Change-Id: Ie2bb1b23bb49f0f3b1a149b8e086c2a943f77508 Closes-Bug: 1655016
This commit is contained in:
		
							
								
								
									
										8
									
								
								.coveragerc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								.coveragerc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,8 @@
 | 
			
		||||
[run]
 | 
			
		||||
source = mistralclient
 | 
			
		||||
omit =
 | 
			
		||||
 .tox/*
 | 
			
		||||
 mistralclient/tests/*
 | 
			
		||||
 | 
			
		||||
[report]
 | 
			
		||||
ignore_errors = True
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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,
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								tox.ini
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user