Combine cobertura code coverage reports of three separate projects - code-coverage

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?

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.

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

Related

Is their way to read jenkins test results irrespective of project types?

i'm looking for generic solution to read test results from jenkin's irrespective of project type.
project type may java, python, maven etc.
basically i need to fetch the test execution results from jenkin's build.How can i do it.
Jenkins expects JUnit XML files. If your test setup of choice does not produce them, you would have to create them on your own after reading the results in some other format (this shouldn't be incredibly hard..).
But as you are not alone, others probably have done this work for you. For Python, there seems to be the junit-xml package. Its description says:
Creates JUnit XML test result documents that can be read by tools such as Jenkins

Jenkins with many solutions in one repository

I am trying to setup Jenkins to automate a build. We have one enormous repository with approximately 100 solution files. To build this repository we have a build program which finds all the solutions and builds in a specified order.
I would like to change that to use Jenkins. Is there a way to setup msbuild and specify a build order for all of these solution files?
p.s. I am trying to avoid creating one mammoth solution file which contains all of the projects.
If in fact all of your projects use ProjectReferences to other VS projects, you should be able to use MSBuild to extract all those references via the ResolveProjectReferences MSBuild task. You can then build an MSBuild script build those dependent projects in order. There's a pretty good example of this here. The example given there goes so far as constructing a specialized MSBuild task that builds a dependency graph, which I must say is pretty cool.

Aggregate jmockit-coverage output with emma coverage output

Is there a way to aggregate code coverage data from jmockit-coverage and emma coverage? I can run the two different coverage steps in two separate junit ant tasks and generate the coverage data in two directories. Just not sure if the coverage outputs from these two are compatible and can be merged to display together.
No, they can't be aggregated into a single HTML report, since these are two different code coverage tools, which know nothing about each other. Of course, someone could create yet another tool which would do that; personally, I don't see much value in it, though.

Creating views of sonar analysis that cuts across multiple modules/packages?

I have a jenkins build that runs sonar analysis on my code base, which is a multi-module maven project. The sonar results allow me to view coverage and issues by drilling down from the project as a whole to the modules, then the packages in those modules, then the classes in those packages.
Is there a way to create different views of the sonar analysis that span different aspects of the project, e.g. "show me the results for packages A,B,C in module M1 and packages X,Y,Z in module M2"?
All this information is (I assume) stored in the database for the project. There may be a plugin that already does this, or maybe I need to write a plugin of my own that queries the database.
I believe the Views plugin should answer your need: http://www.sonarsource.com/products/plugins/governance/portfolio-management/.
If you want an example of how to use it, here is a post on my blog: http://qualilogy.com/en/your-own-quality-model/.
Not recent, but you'll get the idea.
Regards.

Generic ant rules script as an alternative to using Maven

Android has an ant script file with generic targets for compile, clean, etc.
Are there any open source ant scripts that define standard targets such as these for general java projects?
I don't want to bother installing and using maven, but I also don't want to bother creating and maintaining ant scripts for each project.
I'm guessing you are new to both Maven and Ant. If I'm wrong you can ignore the rest of this post :)
I don't know of any generic open source Ant files. I've never had the need to look for one. I think its well worth the effort to learn Ant and create your own generic script. Ant is easy to learn and it is a very flexible, powerful and reliable build tool. You'll find it quite easy to create a build file that you can reuse over and over again on different projects.
With regards to having to maintain Ant scripts, its a bit of a fallacy. You'll find that once you've got a script that works in a generic way you'll hardly ever have to touch it again except when you need to do things in a custom way (usually around packaging and deployment). When that happens, you'll be glad you're using a tool like Ant that gives you the flexibility to do what you want to be able to do without getting in your way.

Resources