我正在使用Jenkins ver。 1.466与Jenkins Cobertura Plugin ver。 1.5。我为Django项目生成了覆盖率报告。所有图表看起来不错,但是当我想看看源代码,我必须警告消息:Jenkins Cobertura插件“源代码不可用”
coverage run manage.py test --noinput
coverage xml -o ../reports/coverage.xml
我试着使用:
sed 's/filename="/filename="my\/path\//g' coverage.xml > coverage2.xml
使用以下步骤生成
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.
覆盖率报告
但没有帮助,Cobertura插件没有找到相对或绝对路径的源代码。
P.S.如果我将源代码放入cobertura目录中,则会出现一些奇怪的问题 - 显示源代码但未突出显示。
试着用'-r .'标志'coverage xml -r执行命令。 -o ../ reports/coverage.xml' – ULazdins
这对Jenkins来说不适用于我。我尝试了一个绝对路径到我的源代码,并且它不起作用。我在github.com/gotwarlost/istanbul/issues/50上读到该路径应该与Jenkins工作区Cobdura目录相关。我尝试过,并相对于工作区目录,但都没有工作。谁能帮忙? – Mawg