Hello,
I have an issue related to code coverage ratio. Our project is on kotling with gradle. We are using sonar cloud with GitHub actions, also the jacoco code coverage plugin configured with gradle. We configured jacoco with minimum code coverage less than 80%, but apparently sonar has its own ratio and cannot be overridden with that one that is using by jacoco.
Other thing is that we configured sonar to scan code per module, as we have a multi-module project.
My question is → Is there a way to configure sonar code coverage minimum percentage? Maybe there is some properties for sonar-properties, or in the github/workflow yml. config file.
So far I didn’t find anything after some researches, just that there some ways to configure Quality Gates from Sonar cloud.
sonar.host.url=https://sonarcloud.io
sonar.organization=****(masked)
sonar.projectKey=****(masked)
sonar.projectName=****(masked)
sonar.cpd.exclusions=/**/*.spec.*,/**/**/*.spec.*,**/__mocks__/*.*,**/__test__/*,**/localDev/**/*,**/test/*
sonar.coverage.exclusions=/**/*.spec.*,/**/**/*.spec.*,**/__mocks__/*.*,**/__test__/*,**/localDev/**/*,**/test/*
sonar.javascript.lcov.reportPaths=apps/gp-portal/build/reports/coverage/lcov.info, apps/****(masked)/build/reports/coverage/lcov.info, packages/****(masked)/build/reports/coverage/lcov.info, apps/admin/build/reports/coverage/lcov.info
sonar.exclusions=*/gradle,**/*.sql
sonar.coverage.jacoco.xmlReportPaths=jacoco/****(masked)/jacocoTestReport.xml,jacoco/****(masked)/jacocoTestReport.xml,jacoco/****(masked)/jacocoTestReport.xml,jacoco/****(masked)/jacocoTestReport.xml,jacoco/****(masked)/jacocoTestReport.xml
Here are the sonar-properties