JaCoCo Selenium测试code的覆盖面和进口声纳使用Ant [英] JaCoCo Selenium test code coverage and import to Sonar using Ant

查看:277
本文介绍了JaCoCo Selenium测试code的覆盖面和进口声纳使用Ant的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过声纳的Ant任务,詹金斯在RHEL环境中触发。我成功地使用的Cobertura针对JUnit code的覆盖面和神火报告。声纳进口神火报告罚款。

I am running Sonar task through Ant, triggered by Jenkins in RHEL environment. I am successfully using Cobertura for Junit code coverage and Surefire for reporting. Sonar imports the Surefire reports fine.

不过,现在我正在运行在詹金斯使用Ant Selenium测试。我想报告code覆盖和测试结果声纳。显然,我需要JaCoCo插件,分析code覆盖面和报告的测试。我presume像单元测试,詹金斯做这项工作和声纳只导入报告到它自己的存储库中。

However, now I am running Selenium tests using Ant in Jenkins. I would like to report code coverage and test results to Sonar. Apparently I need the JaCoCo plugin which analyses code coverage and reports tests. I presume like for unit tests, Jenkins does the job and Sonar only imports the reports into its own repository.

我如何真正做到这一点不解。该网页的http://www.sonarsource.org/measure-coverage-by-integration-tests-with-sonar-updated/到JaCoCo的网页。 http://www.eclemma.org/jacoco/trunk/ DOC / ant.html 。我不知道的步骤是什么工作要做。我需要覆盖的目标?我应该只启动代理?在蚂蚁从哪里开始代理?我需要倾倒东西?

I am puzzled on how to actually do this. The web page http://www.sonarsource.org/measure-coverage-by-integration-tests-with-sonar-updated/ references to the JaCoCo page http://www.eclemma.org/jacoco/trunk/doc/ant.html. I am not sure what the steps are to be done. Do I need the coverage target? Should I only start the agent? Where in Ant do I start the agent? Do I need to dump stuff?

我真的AP preciate所有帮助我能,感谢:)

I really appreciate all the help I can get, thanks :)

推荐答案

声纳3.3具有结合双方的单元测试和集成测试生成code覆盖指标的新功能。 jacoco 的太生成的两个不同的报告文件进行p>

Sonar 3.3 has a new feature for combine code coverage metrics generated by both unit tests and integration tests. This is done by using two properties to detail the two different report files generated by the jacoco too:

#Tells Sonar where the unit tests code coverage report is
sonar.jacoco.reportPath=reports/jacoco/jacoco-ut.exec

#Tells Sonar where the integration tests code coverage report is
sonar.jacoco.itReportPath=reports/jacoco/jacoco-it.exec

声纳例子项目有一个集成测试示例ANT:

The Sonar examples project has an integration test example for ANT:

不幸的是它不给运行的实际测试中的一个例子,而不是它只是显示了如何配置一个Ant构建加载数据。

Unfortunately it doesn't give an example of running the actual tests, instead it just shows how to configure an ANT build to load data.

最后,声纳文档与链接到示例项目的更多细节。

Finally the Sonar documentation has more details with links to the example projects.

这篇关于JaCoCo Selenium测试code的覆盖面和进口声纳使用Ant的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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