No Unit Test Success data for tests written in Groovy

假装没事ソ 提交于 2019-12-14 02:31:23

问题


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:


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.



来源:https://stackoverflow.com/questions/31005808/no-unit-test-success-data-for-tests-written-in-groovy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!