Reputation: 68
Tried with sonar-scanner 2.5 & 2.8
In the 'Rules' section of SonarQube, for JavaScript, I have Branch coverage and Line coverage.
Branch coverage is a Minor, with a minimum coverage ratio of 65
Line coverage is a Major, with a minimum coverage ratio of 70
My code doesn't pass these rules when I run the full sonar over it and read the report on the server.
But if I run it locally in preview mode,
sonar_runner -Dsonar.analysis.mode=preview
On the console, it only reports a minor issue, and looking at the local HTML report, it shows files that are below the Branch coverage. But no major issues flagged, or no reference to files not passing the Line coverage.
I read it doesn't support Quality Gates in preview mode, but it should support Rules, and the fact it reports on the Branch coverage, I'm not sure what has gone wrong. Is anyone else getting Line Coverage rule working in Preview mode?
Any help appreciated, thanks
Upvotes: 2
Views: 612
Reputation: 22824
The preview mode does not do the calculations required to find new issues on coverage or duplications. The old issue you're seeing is pulled from the server.
Upvotes: 0