Test Execution and Test Coverage are distinct. You will need to make sure you’re generating Surefire XML-format reports and passing them to sonar.junit.reportPaths. Take note that sonar.junit.reportPaths is set by default to ${test.testResultsDir} if this is defined in your Gradle context (in which case you shouldn’t need to set anything, except to override)
The reports generated by my two projects are the same, project one is an Android project, project two is a java project, and the package name codes inside are the same, but the test number of the Android project is not displayed, and the java project is displayed, I don’t know why
Thanks. I was suspicious for a moment you might be running a version of SonarQube that didn’t support reading test reports for Kotlin, but that’s not the case.
If you bump the gradle logs up to --info or --debug`, what do they say about the reading of the test reports?
And I was able to see the Unit test count in the UI.
Ideally, build/test-results/testDebugUnitTest would be the value Gradle understands as ${test.testResultsDir} – and this would require no additional configuration (or another way – the test results naturally fall into the directory defined by ${test.testResultsDir} – but I haven’t dug deeper into your project to understand why this isn’t the case.)