I have tried to reconstruct the problem. Can you check if you have explicitly specified where your test files are located using sonar.tests? I admit that this is not additionally written in the documentation.
So I don’t have last line from your replay. Can you explain what sonar.tests that means?
I’m trying to point sonar.tests to folder with tests by pointing to ./tests or tests, but after running some tests, nothing changed with count of Unit tests on Overall Code tab.
In bash log I have:
As mentioned in the documentation, sonar.tests should be set with “comma-separated paths to directories containing test source files”. With this property, your test files can be imported in SonarQube and treated as such. In particular, they can be scanned by test-related rules. SonarQube only displays test execution results for files which are imported as test files.
If you still don’t see test execution results, try running the analysis with debug logs:
sonar-scanner -X
You may then see logs such as:
DEBUG: Following file is not located in the test folder specified in the Sonar configuration: /home/user1/myproject/tests/MyTest.php. The test results won't be reported in Sonar.