Merge lp:~chmouel/testrepository/coverage-package-name into lp:~testrepository/testrepository/trunk

Proposed by Chmouel Boudjnah
Status: Rejected
Rejected by: Robert Collins
Proposed branch: lp:~chmouel/testrepository/coverage-package-name
Merge into: lp:~testrepository/testrepository/trunk
Diff against target: 29 lines (+6/-0)
1 file modified
testrepository/setuptools_command.py (+6/-0)
To merge this branch: bzr merge lp:~chmouel/testrepository/coverage-package-name
Reviewer Review Type Date Requested Status
Robert Collins Needs Fixing
Marc Abramowitz (community) Approve
Review via email: mp+213218@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Marc Abramowitz (msabramo) wrote :

+1. Just ran into this issue today with pbr (my own change request for pbr: https://review.openstack.org/89205).

I can't decide whether I like your name for the option better ("coverage-package-name") or mine ("source"). Your seems clearer and more explicit, though mine matches the name of the option passed to coverage. I don't know. I could go either way.

review: Approve
Revision history for this message
Marc Abramowitz (msabramo) wrote :

https://review.openstack.org/#/c/89205/ was merged for pbr, which adds this same option.

Monty released pbr 0.8.1 with --coverage-package-name option (thanks, Monty!)

Revision history for this message
Robert Collins (lifeless) wrote :

Hi! Could you repropose this to master - https://github.com/testing-cabal/testrepository? Thanks!

review: Needs Fixing
Revision history for this message
Marc Abramowitz (msabramo) wrote :

Unmerged revisions

241. By Chmouel Boudjnah

Add coverage package name

Allow to specify a different package name than the one from the setp.cfg
project.

Fixes bug #1298398

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'testrepository/setuptools_command.py'
2--- testrepository/setuptools_command.py 2013-07-10 11:50:45 +0000
3+++ testrepository/setuptools_command.py 2014-03-28 09:35:05 +0000
4@@ -41,6 +41,7 @@
5 ('coverage', None, "Replace PYTHON with coverage and merge coverage "
6 "from each testr worker."),
7 ('testr-args=', 't', "Run 'testr' with these args"),
8+ ('coverage-package-name=', None, "Use this name for coverage package"),
9 ('omit=', 'o', 'Files to omit from coverage calculations'),
10 ('slowest', None, "Show slowest test times after tests complete."),
11 ]
12@@ -56,6 +57,7 @@
13 self.coverage = None
14 self.omit = ""
15 self.slowest = None
16+ self.coverage_package_name = None
17
18 def finalize_options(self):
19 if self.testr_args is None:
20@@ -86,6 +88,10 @@
21 package = self.distribution.get_name()
22 if package.startswith('python-'):
23 package = package[7:]
24+
25+ # Use this as coverage package name
26+ if self.coverage_package_name:
27+ package = self.coverage_package_name
28 options = "--source %s --parallel-mode" % package
29 os.environ['PYTHON'] = ("coverage run %s" % options)
30

Subscribers

People subscribed via source and target branches