【发布时间】:2017-05-06 14:24:17
【问题描述】:
我在我的 Jenkins-build 中使用gradle-cobertura-plugin。昨天我修复了这个插件中的一个问题,它覆盖了配置的辅助类路径。此问题阻止了某些类出现在覆盖率报告中。修复很简单:
我更改了以下内容:
auxiliaryClasspath = project.files("${project.buildDir.path}/intermediates/classes/${classesDir}")
到
if (auxiliaryClasspath != null) {
auxiliaryClasspath += project.files("${project.buildDir.path}/intermediates/classes/${classesDir}")
} else {
auxiliaryClasspath = project.files("${project.buildDir.path}/intermediates/classes/${classesDir}")
}
使用gradle cobertura 在本地运行构建一切正常,并且缺少的类显示在报告中。
在 Jenkins 上安装插件的补丁版本后,Jenkins 的覆盖率变为零。
环顾所发生的事情,我发现instrumented_classes-文件夹中的类不再被检测!回滚所有内容(build.gradle、卸载我的插件、清除 gradle 缓存等),行为保持不变。由于它在本地工作,我想知道是什么导致了这个问题。
我认为有一些严重错误可能已被记录并被默默忽略,但我不知道在哪里查找此信息。 Jenkins 日志很干净,所以我认为为负责检测的代码添加一个记录器可能会有所帮助。不幸的是,我不知道要启用什么记录器。 org.sourceforge.cobertura 没有输出任何东西。
所以我的问题是:有没有其他人看到这种行为并可能提出如何解决这个问题的线索?
【问题讨论】:
标签: java jenkins gradle cobertura