PBR

pbr uses distribution name for source for coverage; doesn't allow customizing

Bug #1310008 reported by Marc Abramowitz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PBR
Fix Released
Undecided
Unassigned

Bug Description

I was working on jenkins-job-builder and tried to measure coverage by putting this in tox.ini:

```
[testenv:cover]
python setup.py testr --coverage
```

This fails to measure coverage as coverage.py complains with:

```
Coverage.py warning: Module jenkins-job-builder was never imported.
```

Note that the distribution name is "jenkins-job-builder", but the module name is "jenkins_jobs".

Unfortunately, as clarkb points out, pbr only uses the distribution name and doesn't offer a way to customize this.

http://git.openstack.org/cgit/openstack-dev/pbr/tree/pbr/testr_command.py#n107

clarkb:
11:38 pbr is overriding what you are doing
11:38 they dont run in a different dir
11:39 its just overriding the config
11:40 try PYTHON='coverage run --parallel-mode' testr run --parallel && coverage combine
11:44 maybe submit a pbr bug and link to it in tox.ini
11:44 note the coverage html output dir should match pbrs that way jenkins can copy the html for us

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

My workaround is to create a symlink from jenkins-job-builder to jenkins-jobs in tox.ini:

https://review.openstack.org/#/c/87382/2/tox.ini

But it would be nice to not have to do such things.

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

I just submitted a proposed change to make the coverage "source" configurable:

https://review.openstack.org/89205

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

There is a similar bug in testrepository: https://bugs.launchpad.net/testrepository/+bug/1298398

Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to pbr (master)

Reviewed: https://review.openstack.org/89205
Committed: https://git.openstack.org/cgit/openstack-dev/pbr/commit/?id=d68a32126588de9d0e865f546d22293bae269130
Submitter: Jenkins
Branch: master

commit d68a32126588de9d0e865f546d22293bae269130
Author: Marc Abramowitz <email address hidden>
Date: Sat Apr 19 12:30:56 2014 -0700

    Make source configurable when using --coverage

    Change-Id: If5cd9e517d66322027408a59fd99015c91181db8
    Closes-bug: #1310008

Changed in pbr:
status: New → Fix Committed
Revision history for this message
Marc Abramowitz (msabramo) wrote :

Should a new release of pbr to PyPI be done? I would like to use this feature in jenkins-job-builder.

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

There is now a pbr on PyPI that fixes this.

Changed in pbr:
status: Fix Committed → Fix Released
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.