Grails / Cobertura报告 - 有条件的报道没有意义 [英] Grails / Cobertura report - conditional coverage doesn't make sense

查看:120
本文介绍了Grails / Cobertura报告 - 有条件的报道没有意义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能会导致这样的情况:



def result 只显示2/6分支,即使它没有分支,而实际上有条件的下面一行是可以的。



发生了什么事?我验证了 cobertura.ser 在构建之间正在清理。

解决方案

< 任何想法,我可以得到该JAR的来源?


jar souce代码 for disableOptimizationsTransformation


另外 - 任何想法如何将该JAR包含在classpath中,仅用于测试应用程序构建阶段?

  //在战争捆绑之前移除jar 
grails.war.resources = {stagingDir - >
delete(file:$ {stagingDir} /WEB-INF/lib/DisableOptimizationsTransformation-0.1-SNAPSHOT.jar)
}

from 其他帖子在这里


What could cause something like this:

The line def result shows only 2/6 branches covered, even though it has NO BRANCHES, while the following line, which actually has a conditional, is ok.

What's going on? I verified that the cobertura.ser is getting cleaned up between builds.

解决方案

any idea where I can get the source for that JAR?

jar and souce code for disableOptimizationsTransformation

Also - any idea how to include that JAR on classpath ONLY for the test-app build phase?

// Remove the jar before the war is bundled
grails.war.resources = { stagingDir ->
  delete(file:"${stagingDir}/WEB-INF/lib/DisableOptimizationsTransformation-0.1-SNAPSHOT.jar")
}

from other post here

这篇关于Grails / Cobertura报告 - 有条件的报道没有意义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆