Jenkins - database backend or separate database for reporting (Sonar?)

1,022 views
Skip to first unread message

Keith B. Perry

unread,
Nov 14, 2011, 11:52:11 AM11/14/11
to jenkins...@googlegroups.com
Hi all,
I am currently manually generating some reports for management, and I would like to automate these.  The reports themselves just show the exact numbers of each project at the end of each month.  It would be great if each time a build was fired off, it would write a record to the database and update it with statistics (cyclomatic complexity, static analysis, compiler warnings, code coverage, etc...).  Sonar looks promising, but we have a very diverse environment (Java, C++, C, C#, python) that I am not sure it would be able to handle.  

Does anyone have any experience out there with Sonar and C++ tools?

Any good ideas how to have Jenkins automatically throw records in a database?

Grégory Boissinot

unread,
Nov 14, 2011, 4:56:50 PM11/14/11
to jenkins...@googlegroups.com
Which metrics tools do you use?

Sonar provides some plugins to support Java, C/C++, C# and so on. These plugins run the metric tool (run step) and record metrics results in Sonar database (collect step). These informaion can then be displayed in the Sonar Web dashboard.

However, I strongly suggest running the metrics tools from Jenkins (run step). The Jenkins role is to set  up an environment and to instanciate the integration process.
Therefore, metrics tools are executed from Jenkins (or from a process such as your build tool, managed by Jenkins).
Then these metrics results can be processed and convert them in a generic format.

These output can then be sent to a datastore or to Sonar if you want to use Sonar as a generic metrics platform. In the last case, Sonar is only aimed at collecting metrics results and at displaying them.  In my opinion, that's the right approach.

Please look at the DTKit ecosystem

Keith B. Perry

unread,
Nov 14, 2011, 5:52:36 PM11/14/11
to jenkins...@googlegroups.com
Greg,
I will look into Sonar further, but it looks like your comments should help a ton.  Thanks for the information!  

In Jenkins we are currently using: cppcheck, pc-lint, cccc to name a few for C++ (they don't seem to be really common tools used in Jenkins).  We are also using cobertura and junit, but we are doing some post processing from  gcov and google c++ testing framework to get in the respective format.  We are also using valgrind (memory leak checker), but we convert that output to junit as well.

Grégory Boissinot

unread,
Nov 14, 2011, 6:30:44 PM11/14/11
to jenkins...@googlegroups.com
Regarding the C++ tools integration in Jenkins and for your tools, there are:
- a Cppcheck Jenkins plugin
- a CCCC Jenkins plugin

For gcov, do you use the python script gcovr to obtain a cobertura report?
The latest google c++test version should generate a native JUnit format. Wich additionnal processing procedure do you use?
For Valgrind, the xUnit Jenkins plugin provides the Valgrind integration.

Keith B. Perry

unread,
Nov 18, 2011, 12:41:24 PM11/18/11
to jenkins...@googlegroups.com
We do use the cppcheck, cccc Jenkins plugins.  For gcov, we also use the gcovr for the cobertura report (although I manually edited the script to exclude conditionals).  You are right on the google testing, we just pass the -xml switch.  I wasn't aware of the xUnit /Valgrind integration.  I am using a xsl that someone threw on github/bitbucket that transforms valgrind xml output to JUnit, and it works well (better than the python script in the same repo).

After installing Sonar, and the Jenkins Sonar plugin, I am a bit confused on your advice above.  Sonar provides a build step (if you aren't using Maven - which we aren't), and it looks like that is the "run" step.  And then there is the post build "Sonar" option, which I believe is the "Send" so the sonar db can "Collect" step.

Can you give me a bit more advice on how to convert the jenkins metrics (cppcheck...etc) to Sonar readable format and then how to use the Jenkins/Sonar plugin to send that converted data?

Michael Barbine

unread,
Dec 16, 2013, 11:37:48 AM12/16/13
to jenkins...@googlegroups.com

Indra Gunawan (ingunawa)

unread,
Dec 17, 2013, 1:37:59 AM12/17/13
to jenkins...@googlegroups.com
SQLServer, a database for Window only, is something you want to use with Jenkins? Yikes!!!  

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Michael Barbine

unread,
Dec 17, 2013, 6:17:11 AM12/17/13
to jenkins...@googlegroups.com
It works really well for our ops. I'm hoping someone will take this and make it work on something else and repost though. I needed some of the built in functionality in sql though. 


Sent from my Samsung Galaxy S®4
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/AXUdweW8jRQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages