generated xml invalid paths for Cobertura report · Issue #526 · nedbat/coveragepy (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@nedbat

Description

@nedbat

Originally reported by Dirk Thomas (Bitbucket: dirk-thomas, GitHub: dirk-thomas)


When generating the coverage report as a .xml file the source + filename does not add up to a correct path. As a result the Jenkins Cobertura plugin can't show the source of each module: http://ci.ros2.org/job/test_coveragepy/2/cobertura/_/ament_package_dependency_py/

I have created a Jenkins job to reproduce the issue: http://ci.ros2.org/job/test_coveragepy/2/

The steps are fairly simple:

cd  /tmp
python3 -m venv venv
. venv/bin/activate
pip install coverage mock nose
git clone https://github.com/ament/ament_package.git
cd ament_package
python3 -m nose --nocapture --with-coverage --cover-package ament_package --cover-xml --cover-xml-file coverage.xml

The resulting coverage.xml file contains a source entry pointing to the Python module .../ament_package/ament_package. The class entries have a filename like ament_package/dependency.py and a name (dependency.py). The problem is (as far as I can see) that the source + filename doesn't add up to a correct path. Basically the package name folder is repeated in both. The correct full path should be .../ament_package/ament_package/dependency.py.

The full console output can be found here and the full coverage.xml file here.