Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No report was found for sonar.python.coverage.reportPaths using pattern coverage-reports/coverage.xml

My sonar branch coverage results are not importing into sonarqube. coverage.xml are generating in jenkins workspace. following are the below jenkins and error details : WARN: No report was found for sonar.python.coverage.reportPaths using pattern coverage-reports/coverage.xml

I have tried in my ways but nothing worked.

    withSonarQubeEnv('Sonarqube') {
      sh "${scannerHome}/bin/sonar-scanner -Dsonar.login=$USERNAME -Dsonar.password=$PASSWORD -Dsonar.projectKey=${params.PROJECT_KEY} -Dsonar.projectName=${params.PROJECT_NAME} -Dsonar.branch=${params.GIT_BRANCH}  -Dsonar.projectVersion=${params.PROJECT_VERSION} -Dsonar.sources=. -Dsonar.language=${params.LANGUAGE} -Dsonar.python.pylint=${params.PYLINT_PATH} -Dsonar.python.pylint_config=${params.PYLINT} -Dsonar.python.pylint.reportPath=${params.PYLINT_REPORT} -Dsonar.sourceEncoding=${params.ENCODING} -Dsonar.python.xunit.reportPath=${params.NOSE} -Dsonar.python.coverage.reportPaths=${params.COVERAGE}"        
    }

I expect my coverage results to reflect on sonar

like image 884
Sridevi Raman Avatar asked Feb 27 '26 07:02

Sridevi Raman


1 Answers

You are having that error because you are specifying the coverage report path option wrong, and therefore sonar is using the default location coverage-reports/coverage.xml.

The correct option is -Dsonar.python.coverage.reportPath (in singular).

like image 171
gmc Avatar answered Mar 01 '26 20:03

gmc



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!