JUnit 5 ParameterizedTests not counted

500 views
Skip to first unread message

michel...@gmail.com

unread,
Nov 24, 2017, 9:41:44 AM11/24/17
to SonarQube
Hi, 

I think there is a little bug in the current Version 6.7 of sonarqube (or in the java plugin?). Tests written as Junit 5 @ParameterizedTest are not counted as Tests in the overview.

Here a little test project that has 100% Test Coverage with ZERO tests: https://github.com/erard22/sonar-test

Cheers, 

Mike

Michael Gumowski

unread,
Dec 4, 2017, 11:37:02 AM12/4/17
to michel...@gmail.com, SonarQube
Hey Mike,

Thanks a lot for your feedback. We are obviously unable to read correctly the surefire report when parametrized tests are used.
Out of curiosity, how many tests would you count in your sample project? 1 (one physical declared test method) or 2 (runned tests) ?

I created the following ticket to handle parametrized tests: SONARJAVA-2580

Cheers,
Michael

--
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/7b842060-b972-42ed-84e5-9bcbc25586aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Michael Gumowski | SonarSource
Software Developer, Language Team
https://www.sonarsource.com

michel...@gmail.com

unread,
Dec 5, 2017, 5:11:17 AM12/5/17
to SonarQube
Hi Michael, 

I already asked myself this question. I don't know the correct answer. At least not zero;-) I think I would tend to count it as one single test and not summarized the different runs, because they run the same test. The same for @RepeatedTests btw. 

Cheers, 

Michel

Michael Gumowski

unread,
Dec 6, 2017, 5:39:17 AM12/6/17
to michel...@gmail.com, SonarQube
Thanks Michel for noticing @RepeatedTest. I added it to the ticket and completed the use case. I also think counting it once is logical... but looking at the the surefire reports, you can clearly see the distinct runs of each of theses tests... So, let's try to at least count them first, how many times is another story!

Cheers,
Michael


For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages