Jenkins Cobertura Plugin Source Unavailable

I am using Jenkins ver. 1.466 with Jenkins Cobertura Plugin ver. 1.5 . I created a Django project coverage report. All the diagrams look good, but when I want to see the source code, I have a 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. 

A coverage report is created using the following steps:

 coverage run manage.py test --noinput coverage xml -o ../reports/coverage.xml 

I tried using:

 sed 's/filename="/filename="my\/path\//g' coverage.xml > coverage2.xml 

but it didn’t help, the Cobertura plugin did not find the source code with a relative or absolute path.

PS Some strange problem, if I put the source code in the cobertura directory - the source code is displayed but not highlighted.

+4
source share
2 answers

Do you have the option "Undo old builds" or some kind of reclone option and start from scratch? If not, you may want to view archiving artifacts and add your coverage file to the list.

+1
source

The output xml file must be in the same folder as coverage , so:

 coverage xml -o coverage.xml 

The link to the source folder is placed in coverage.xml , and if the output file is placed in another folder, the link to the source folder will be incorrect.

+1
source

Source: https://habr.com/ru/post/1415141/


All Articles