I moved this to Get Help as this is known behavior.
As a part of the drop of modules back in SonarQube v7.6 (MMF-365 ), we changed the generic coverage/test reports sensors to be global sensors (SONAR-11530), meaning they only run once for the project (and not for each module).
This means that, for example, users who have sonar.testExecutionReportPaths set in a module’s pom.xml file will no longer have Test Execution data reported.
Feel free to make a suggestion if you think this should be changed (or i can move this thread there). It’s not something we’ve gotten a lot of feedback on.
Hi Colin, Thanks for the reply. Let me explain my view on this.
First, MMF-365 is very confusing in terms of making a clear distinction about what the word modules means there. Its mentioned - drop the concept of module in SQ/SC So I’m assuming its only related to dropping the module functionality at SQ/SC
Allow me to chime in as I just spent a few hours going back and forth with different configuration trying to understand why I am not seeing the frontend tests listed in SQ.
We have the exact same setup as the OP: Maven multi-module with the frontend (Maven) module using the jest-sonar-reporter.
SQ ignoring the sonar.testExecutionReportPaths property defined at module level is IMO a violation of the principle of least astonishment (POLA) - particularly when scanning with Maven. With Maven a property defined at level N+1 (nearly) always replaces a property of the same name at level <=N.
What if you had two frontend modules frontend-A and frontend-B with both having their test-report.xml in different folders? Sure, you can put both paths comma-separated into sonar.testExecutionReportPaths. However, while scanning frontend-A SQ will complain about the missing 2nd path and while scanning frontend-B it will complain about the missing 1st path.
I have also lost countless hours with that issue. SonarScanner for .NET relies heavily on modules. It took me long enough to figure out how to configure an angular app sitting within a normal web project. To get everything working, I needed to add sonar properties to the .csproj file.
Naturally, I stopped seeing seeing JS unit test results. But I had no idea why.
If you really do not want to fix the issue, then please write at least an error message.