--coverage fail when the package name is different from the project name

Bug #1298398 reported by Chmouel Boudjnah
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Testrepository
Triaged
Wishlist
Unassigned

Bug Description

On a personal blog my setup.cfg my project/software name is :

[metadata]
name = package-foo
[...]
[files]
packages =
  foo

my package name is actually called foo locally on my filesystem and this is what I would like to test. testrunner force it to have the package from distribution.get_name() (i.e: package name) according to this code :

http://pastie.org/pastes/8973154/text?key=u4oiulumxb5rt9k7okrgoq

Here is patch that add a new option --coverage-package-name= to be able to set it to what we want :

http://pastie.org/pastes/8973213/text?key=5spizx2cvqsjamotsjaaza

(I think nosetests has a similiar option as well).

Let me know what do you think so I can submit it.

Related branches

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

We can do this sure. I think you'll find that pbr has taken over the setup.cfg glue though. IMBW.

Changed in testrepository:
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
Chmouel Boudjnah (chmouel) wrote :

I think I am using pbr, I have only this with my setup.py

setuptools.setup(setup_requires=['pbr>=0.5.21,<1.0'],
                 pbr=True)

and this in my setup.cfg :

[global]
setup-hooks =
    pbr.hooks.setup_hook

oh well, i'll just ping monty :) but i think this patch may still be worthwhile

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

Sounds like the same (or similar) issue as:

https://bugs.launchpad.net/pbr/+bug/1310008

I submitted a changeset for this to pbr:

https://review.openstack.org/89205

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

https://review.openstack.org/#/c/89205/ for pbr was merged. So it might be nice to support this in testrepository for consistency.

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

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

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.