test coverage doesn't report any data

Bug #1655920 reported by Markus Zoeller (markus_z)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nova-dpm
Fix Released
Undecided
Tin Lam

Bug Description

Description
===========
We cannot create a test coverage report with the tox test env "cover"

Steps to reproduce
==================
    $ git clone https://github.com/openstack/nova-dpm
    $ cd nova-dpm
    $ tox -e cover

Expected result
===============
A test coverage report gets created.

Actual result
=============
No coverage report, but warnings instead:
    Coverage.py warning: Module nova-dpm was never imported.
    Coverage.py warning: No data was collected.
    Ran 10 tests in 9.215s (-0.482s)
    PASSED (id=9)
    No data to report.

Environment
===========
$ git log --oneline -1
6f87677 Instance Destroy,poweron,poweroff,reboot

Logs & Configs
==============

    $ tox -e cover
    cover installed: [...]
    Coverage.py warning: Module nova-dpm was never imported.
    Coverage.py warning: No data was collected.
    Coverage.py warning: Module nova-dpm was never imported.
    Coverage.py warning: No data was collected.
    Coverage.py warning: Module nova-dpm was never imported.
    Coverage.py warning: No data was collected.
    Coverage.py warning: Module nova-dpm was never imported.
    Coverage.py warning: No data was collected.
    Coverage.py warning: Module nova-dpm was never imported.
    Coverage.py warning: No data was collected.
    Coverage.py warning: Module nova-dpm was never imported.
    Coverage.py warning: No data was collected.
    Coverage.py warning: Module nova-dpm was never imported.
    Coverage.py warning: No data was collected.
    Coverage.py warning: Module nova-dpm was never imported.
    Coverage.py warning: No data was collected.
    Ran 10 tests in 9.215s (-0.482s)
    PASSED (id=9)
    No data to report.

Changed in nova-dpm:
assignee: nobody → Markus Zoeller (markus_z) (mzoeller)
Changed in nova-dpm:
assignee: Markus Zoeller (markus_z) (mzoeller) → nobody
Revision history for this message
Markus Zoeller (markus_z) (mzoeller) wrote :

It has to be something with the paths in the tox configuration ("tox.ini") or coverage configuration (".coverage.rc"). I can do this to create results:

    $ git clone https://github.com/openstack/nova-dpm
    $ cd nova-dpm
    $ tox -e cover
    $ source .tox/cover/bin/activate
    $ (cover) coverage run --source=nova_dpm -m unittest discover -s nova_dpm/tests/
    $ (cover) coverage report

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova-dpm (master)

Fix proposed to branch: master
Review: https://review.openstack.org/420208

Changed in nova-dpm:
assignee: nobody → Tin Lam (tl3438)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova-dpm (master)

Reviewed: https://review.openstack.org/420208
Committed: https://git.openstack.org/cgit/openstack/nova-dpm/commit/?id=ce0676d3d8e2ffa3b473884fa6db19df1e4bbc0a
Submitter: Jenkins
Branch: master

commit ce0676d3d8e2ffa3b473884fa6db19df1e4bbc0a
Author: Tin Lam <email address hidden>
Date: Fri Jan 13 15:54:07 2017 -0600

    Fix an issue where no test coverage report is created

    Running `tox -ecover` does not generate the coverage report.
    Instead the following is displayed to the user:

        No coverage report, but warnings instead:
        Coverage.py warning: Module nova-dpm was never imported.

    This patch set fixes the problem.

    Change-Id: Iec85cf3a6453da3630d49df29c69b55ca5075d17
    Closes-Bug: #1655920

Changed in nova-dpm:
status: In Progress → 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.