Jenkins Cobertura插件无法找到源代码

时间:2019-08-22 14:44:51

标签: c++ jenkins cobertura cppunit

我已经在我的jenkins服务器上复制了一个现有的cppunit项目。现有项目正确显示了测试报告和相关的源代码。我正在为新创建的项目使用完全相同的脚本以及一些附加功能。 新创建的项目确实以某种方式显示了以下错误:该项目没有源代码,因此仅显示了非常基本的测试报告。关键是两个项目都具有相同的根目录,结果目录和脚本文件夹。因此,一切都一样,但是Cobertura的工作却不同。

我检查了两个测试的生成的coverage.xml文件,并且工作代码与没有显示图表的coverage文件相比,没有关于代码位置的任何其他信息。 我还尝试在与该问题有关的其他问题(例如Jenkins Cobertura plugin "Source code is unavailable")上寻求帮助,但它们仅显示了我认为我已经做过的事情。

这是错误:

Source code is unavailable. Some possible reasons are:
    This is not the most recent build (to save on disk space, this plugin only keeps the 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.
    You do not have sufficient permissions to view this file.

我们的詹金斯执行以下操作以从gcda生成coverage文件

lcov --capture --directory ./"$sourceDir"/"$exePathOnHost" --output-file ./Results/coverage.info
python ./Scripts/gcov_to_xml.py ./Results/coverage.info  -o ./Results/coverage.xml -d

我的想法很重要:

  1. 不。这是最近的版本
  2. 我不知道该如何处理-在具有相同设置,源代码和脚本的其他项目上,它工作正常
  3. 与2相同
  4. 我是jenkins的root用户或admin-jenkins还能问什么?

在给定的设置下,我希望cobertura像其他项目一样显示我的台词,但事实并非如此,我不明白为什么会这样。在我看来,这绝对是随机的。

也许您能给我一个提示,在哪里进行进一步的搜索?

0 个答案:

没有答案