I'm using Jenkins ver. 1.466 with Jenkins Cobertura Plugin ver. 1.5. I generated coverage report for Django project. All charts looks good, but when I want to see source code I have warning message:
Source code is unavailable. Some possible reasons are:
This is not the most recent build (to save on disk space, this plugin only keepsthe most recent builds source code).
Cobertura found the source code but did not provide enough information to locate the source code.
Cobertura could not find the source code, so this plugin has no hope of finding it.
Coverage report is generated using these steps:
coverage run manage.py test --noinput
coverage xml -o ../reports/coverage.xml
I tried to use:
sed 's/filename="/filename="my\/path\//g' coverage.xml > coverage2.xml
but didn't help, Cobertura plugin didn't find source code not with relative or absolute path.
P.S. Some strange issue if I put source code into the cobertura directory - source code is displayed but not highlighted.
-r .
flagcoverage xml -r . -o ../reports/coverage.xml
– Chill