我在用着詹金斯版本。 1.466 with Jenkins Cobertura 插件版本。 1.5。我为 Django 项目生成了覆盖率报告。所有图表看起来都不错,但是当我想查看源代码时,我收到警告消息:
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 run manage.py test --noinput
coverage xml -o ../reports/coverage.xml
我尝试使用:
sed 's/filename="/filename="my\/path\//g' coverage.xml > coverage2.xml
但没有帮助,Cobertura 插件找不到不带相对或绝对路径的源代码。
附:如果我将源代码放入其中,会出现一些奇怪的问题科贝尔图拉目录 - 显示源代码但不突出显示。
输出 xml 文件必须与所在文件夹位于同一文件夹中coverage
运行,所以:
coverage xml -o coverage.xml
对源文件夹的引用放入coverage.xml
如果将输出文件放入另一个文件夹,则对源文件夹的引用将不正确。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)