Combine cobertura code coverage reports of three separate projects

邮差的信 提交于 2019-12-10 17:18:35

问题


I have three projects which are stored in three separate repositories. Each of them is a individual mvn project. I wonder is there a way to aggregate three reports in one?

I took a look at the cobertura aggregate function. But seems like it can only handle sub-modules of a project.

Anybody has any suggestion?


回答1:


The Maven plugin goal cobertura:cobertura supports an aggregate parameter that would work for all the projects in the reactor I suppose.

But you seem to suggest the projects might not be in the same structure/reactor, and i wouldn't know how to do it with maven per-se. However, you can easily do it with a little ant script that can be integrated in your maven structure.

The Cobertura Ant library has a merge task that can merge a number of .ser files (generated by the runtime execution of your instrumented code). This will generate a combined .ser file for which you can generate a xml or html report from.

Let me know if you need more pointers.




回答2:


In another question a responder gave a link to a python script they had written that did what you are asking, I moved that "xml combiner" to a gist that is located here



来源:https://stackoverflow.com/questions/19792510/combine-cobertura-code-coverage-reports-of-three-separate-projects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!