SonarQube 5.3 RC2: metric test_success_density not working

309 views
Skip to first unread message

Günter Wirth

unread,
Jan 2, 2016, 10:49:40 AM1/2/16
to SonarQube
Hi,

After upgrading to SQ 5.3 RC2 metric test_success_density is no more working asking over the rest API. Looking to https://github.com/SonarSource/sonarqube/blob/master/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java#L453 it's still there.

Regards,
Günter

Fabrice Bellingard

unread,
Jan 4, 2016, 5:28:36 AM1/4/16
to Günter Wirth, SonarQube
Hi Gunter,


Can you double-check?

Best regards,

Fabrice BELLINGARD | SonarSource
SonarQube Platform Product Manager
http://sonarsource.com

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/e9747449-801a-4dc0-a771-f9504928d930%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jorge Costa

unread,
Jan 4, 2016, 6:07:20 AM1/4/16
to Fabrice Bellingard, Günter Wirth, SonarQube
Hi Fabrice,

this was taken with 5.3 RC2 and using c# plugin 4.4 and msbuild runner.

test-metrics-cs-plugin.png
seems that some plugins no longer show the success density. but i am ensure about if this is a 5.3 issue or 5.2. I can confirm later this week.

also i am unable to find a c# project in nemo that contains test coverage, perhaps something can be added?

br,
jc

Sebastien Lesaint

unread,
Jan 4, 2016, 6:51:15 AM1/4/16
to SonarQube
Hello,

Internal reply here.

I've looked at the code. Unit test density is not computed when there is no test (metric tests = 0).

Could that be a change from before?

Sébastien LESAINT | SonarSource
Platform Developer

Sebastien Lesaint

unread,
Jan 4, 2016, 8:55:03 AM1/4/16
to SonarQube
Sorry for the noise, this email was indeed not meant to go to the mailing list.

Sébastien LESAINT | SonarSource
Platform Developer

Günter Wirth

unread,
Jan 4, 2016, 10:03:52 AM1/4/16
to SonarQube, wirth....@me.com
Hi Fabrice,

we have a integration test for our plugin running testing with SQ 4.5.6, SQ 5.1.2 and SQ 5.3-RC2. Environment and scripts are for all three versions the same but asking for metric' test_success_density' we get None with SQ 5.3-RC2. So we are quit sure that %.3 has changed behaviour. You can find the log files here https://travis-ci.org/SonarOpenCommunity/sonar-cxx/builds/99831521 selecting a version and scrolling to the end (Java 7 problems are because of Travis).

See https://travis-ci.org/SonarOpenCommunity/sonar-cxx/jobs/99831524 Assertion Failed: test_success_density is actually None

@Sebastian: One of our integration tests should have test_success_density 33.3 but have None, so there are tests.

Regards,
Günter

Jorge Costa

unread,
Jan 5, 2016, 2:46:18 AM1/5/16
to SonarQube, wirth....@me.com
just to confirm 5.2 shows same behaviour

Julien Lancelot

unread,
Jan 5, 2016, 10:18:29 AM1/5/16
to Jorge Costa, SonarQube, Günter Wirth
Hi all,

This issue is indeed coming from SonarQube 5.2, as the goal was to have only one way to compute this measure.
As it's not possible to compute it for all plugins, I've created a ticket to allow this measure to be send to any component : https://jira.sonarsource.com/browse/SONAR-7170.

Regards,

Julien LANCELOT | SonarSource

Günter Wirth

unread,
Jan 6, 2016, 5:29:08 AM1/6/16
to SonarQube, jmec...@gmail.com, wirth....@me.com
Hello Julien,

Thanks a lot for your answer.

> Since SonarQube 5.2, it was not possible for a plugin to send the measure 'test_success_density' to other components that file. The goal was to have only one way to compute this measure. But as some plugins do not provide measures required to compute it ,it should be possible for a language plugin to send this measure to any component.


I don't catch the point behind it. Could you please explain a little bit more what the problem is?

> was not possible for a plugin to send the measure 'test_success_density' to other components that file

What does this mean?

> But as some plugins do not provide measures required to compute it

Is there anything we can do in our plugin?

Regards,
Günter

Julien Lancelot

unread,
Jan 6, 2016, 6:03:30 AM1/6/16
to Günter Wirth, SonarQube, Jorge Costa
Hi,

Since SonarQube 5.2, sensor can only send a limited number of measures, defined in this list : https://github.com/SonarSource/sonarqube/blob/master/sonar-core/src/main/java/org/sonar/core/metric/BatchMetrics.java.
If a metric is not in this list, then measures computed on it will be ignored.

Other metrics should be aggregated by the platform or by a MeasureComputer.

So in order for a sensor to send test_success_density, we need to update BatchMetrics.

Regards,
Julien LANCELOT | SonarSource

Reply all
Reply to author
Forward
0 new messages