Jenkins - aggregate test results (SonarQube/JUnit) from multiple projects - jenkins

I am currently working on a project which consists of several applications which in our infrastructure are tested with SonarQube and JUnit. For the moment I receive test reports for each subproject (application) separately.
My question is : what tools or solutions do you use to generate a report across multiple independent Maven projects to aggregate the test results generated by JUnit / Maven / Surefire ?
For the moment I came across SonarQube Governance plugin, however I would like to know the alternatives.

The Governance plugin ($) is the only solution to aggregate projects. However, if you're talking about aggregating multiple test reports within a single project, that functionality is native in SonarQube 6.2. Further, for projects with sub-projects, the aggregation of sub-project data should happen naturally in the parent project.

Related

BDD Serenity Jenkins consolidate multiple report into a single report

I am using Serenity BDD for my project. I have divided feature files into different functional areas and they are in turn represented as separate Jenkins jobs. The problem I am facing is the Jenkins jobs generate separate report and the client requires a single report. I was wondering if somebody has tried Jenkins Copy artifact + Serenity aggregate to consolidate reports into a single serenity report. It would be great if you can share may be another (alternate) simpler report to do it. Cheers

Sonar - Building Solution With Projects That Have Different Configurations

I'm having some trouble with performing analysis on a project, and I'm not quite sure how to work around it.
I am working with an engineer to get one of their applications into Sonar. It's a large solution with many projects as part of it. When I performed a build and Sonar analysis as part of a TFS build, I get the following error:
##[error]No analysable projects were found but some duplicate project IDs were found. Possible cause: you are building multiple configurations (e.g. DEBUG|x86 and RELEASE|x64) at the same time, which is not supported by the SonarQube integration. Please build and analyse each configuration individually.
I took a look at the configuration management in their solution properties and found that there were some different configurations per project. Most were set up for Debug|Any CPU, but there were a couple set up for Debug|x86 and Dev|Any CPU.
I tried building just one particular project by using the MSBuild argument /t:, but still ran into the same thing. I've also tried specifying the configuration and platform as MSBuild arguments, but no luck. Is there any possible way to do the analysis without having to change the configuration of the projects directly?
Any help would be appreciated! Let me know if you need any additional information.
According to this website, SanarQube has no plans at the moment to support multiple configurations in the short term.
You would need to setup a separate single configuration build for the SonarQube analysis.

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.

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.

Combine cobertura code coverage reports of three separate projects

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

Resources