Integrate Spock's test with Sonar

前端 未结 1 1987
盖世英雄少女心
盖世英雄少女心 2021-01-04 20:38

I use spock to write test case and jenkins to run and publish my test cases. I was able to get the code coverage reported but sonar shows me only Java Unit

1条回答
  •  囚心锁ツ
    2021-01-04 21:28

    1. Install the Groovy plugin in Sonar. Login as admin/admin and go to the administration/system/update-center tab
    2. Add the following property in the pom file

      src/test/groovy,src/test/java

    If you do this both Spock and JUnit tests are shown correctly! See attached screenshot

    0 讨论(0)
提交回复
热议问题