Warning on pull request analysis coverage

I was trying config the pull request coverage analysis, and i face the warning bellow and i dont have a analysis. I make a double check about sonar.properties and parameters like source dir, tests dir and reportPath. Always unsucessfully.

Failed to resolve 219 file path(s) in PHPUnit tests phpunit.xml report. Nothing is imported related to file(s):

.sonarcloud.properties

sonar.sources=api/src
sonar.test=api/tests
sonar.language=php
sonar.sourceEncoding=UTF-8

sonar.php.tests.reportPath=api/build/logfile.xml
sonar.php.coverage.reportPaths=api/build/coverage.xml

sonar.exclusions=api/vendor/**, api/app/**, api/bootstrap/**, api/config/**, api/database/**, api/grafana/**,  api/public/**, api/storage/**

drone step

sonar-scanner -Dsonar.pullrequest.branch=$DRONE_SOURCE_BRANCH -Dsonar.pullrequest.key=$DRONE_PULL_REQUEST -Dsonar.login=$SONAR_REGISTRATION_LOGIN -Dproject.settings=.sonarcloud.properties

when run with debug mode, the result has

14:26:52.905 WARN: Failed to resolve 219 file path(s) in PHPUnit tests logfile.xml report. Nothing is imported related to file(s): /drone/src/api/tests/.....;.....;

All files are there, with a correct path. But what cause the warning to sonar??

Hey @celosauro,

Welcome to the community!

Can you try with sonar.tests instead of sonar.test in your sonar.properties file? That should be the correct parameter (see https://sonarcloud.io/documentation/advanced-setup/analysis-parameters/).

Best,
Karim.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.