Bug 60494 - Add sonar analysis to build
Summary: Add sonar analysis to build
Status: RESOLVED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 3.1
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-18 10:14 UTC by Felix Schumacher
Modified: 2016-12-18 13:14 UTC (History)
1 user (show)



Attachments
Add a sonar task to build (9.57 KB, patch)
2016-12-18 10:14 UTC, Felix Schumacher
Details | Diff
Add sonar task to build (10.25 KB, patch)
2016-12-18 11:08 UTC, Felix Schumacher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Schumacher 2016-12-18 10:14:07 UTC
Created attachment 34532 [details]
Add a sonar task to build

It would be nice to add sonar analysis to the build script.

The attached patch adds sonarqube-ant-task and another "complete" junit - enhanced with coverage - task to the build script. It would be nice to use the already implemented coverage functionality, but I have to admit, that I don't know how to activate it.

The new task can be used with a local sonarqube installation running in default configuration, or it can use environment variables to point to a custom installation. The environment variables are:
 SONAR_HOST_URL
 SONAR_LOGIN
 SONAR_PASSWORD
 SONAR_JDBC_URL
 SONAR_JDBC_USERNAME
 SONAR_JDBC_PASSWORD
Comment 1 Felix Schumacher 2016-12-18 11:08:44 UTC
Created attachment 34533 [details]
Add sonar task to build

Move jmeter.version on level up, so that sonar task can use it.
Change sonarKey to begin with org.apache.jmeter
Comment 2 Felix Schumacher 2016-12-18 11:12:53 UTC
Date: Sun Dec 18 11:12:17 2016
New Revision: 1774875

URL: http://svn.apache.org/viewvc?rev=1774875&view=rev
Log:
Add sonar analysis task to build

Bugzilla Id: 60494

Modified:
    jmeter/trunk/build.properties
    jmeter/trunk/build.xml
    jmeter/trunk/test/src/org/apache/jmeter/JMeterVersionTest.java
    jmeter/trunk/xdocs/changes.xml
Comment 3 Felix Schumacher 2016-12-18 11:58:35 UTC
Date: Sun Dec 18 11:57:53 2016
New Revision: 1774880

URL: http://svn.apache.org/viewvc?rev=1774880&view=rev
Log:
Move definition of sonar namespace to sonar task, so that it works,
even when sonar lib was just downloaded.

Bugzilla Id: 60494

Modified:
    jmeter/trunk/build.xml
Comment 4 Philippe Mouawad 2016-12-18 13:14:00 UTC
Thanks a lot Felix for your work on this !
It's great.

For reference,  how did you make the Jenkins configuration ?
I see you added a call to "sonar" task (https://builds.apache.org/view/All/job/JMeter-trunk/configure) in build.
But I don't see where you configured all the env properties.

Is it injected with "Prepare environnement for SonarQube Scanner" checkbox ?
Is there some documentation you relied on ?


Thank you