No Unit Test Success data for tests written in Gro

2019-08-08 02:06发布

I haven't used Sonar in project with mixed Java and Groovy files for over a year and it is great that SonarQube has become able to support multiple languages in the same project/module (instead of making two separate analyzes for Java and Groovy). Unfortunately I spotted a regression.

In the past for Java project with tests written in Spock/Groovy they were normally reported in a test summary. Currently for that projects there is entire "Unit test success" section missing. It seems that the problem is that those data are provided only but SurefireSensor. In Java project with tests in Spock there are warnings:

INFO  - Sensor SurefireSensor
INFO  - parsing /home/foo/my-gradle-project/build/test-results
WARN  - Resource not found: io.foobar.FileSystemPollerSpec
WARN  - Resource not found: io.foobar.PropertiesFolderFinderSpec

Looking a the code SurefireSonsor gathers only Java source files and skips results for other files (in the past there were gathered, only source files were not displayed)

Similar situation is for a project completely in Groovy. In that case SurefireSonsor is not even executed and "Unit test success" is completely missing. The issue can be reproduced with: https://github.com/SonarSource/sonar-examples/tree/master/projects/languages/groovy/groovy-sonar-runner-jacoco

Tested with SonarQube 5.1.1, Java plugin 3.0, Groovy plugin 1.1.1 and SonarRunner 2.4.

Is there any other way to get "Unit test success" for tests in Groovy/Spock for Groovy or mixed Java/Groovy projects?

1条回答
混吃等死
2楼-- · 2019-08-08 02:33

This is a known limitation of the Groovy plugin. There is an open ticket: http://jira.sonarsource.com/browse/SONARGROOV-2 It should be fixed in next sprint.

查看更多
登录 后发表回答