codacy / codacy-coverage-reporter

Multi-language coverage reporter for Codacy
https://www.codacy.com
Other
134 stars 94 forks source link

[CY-2634] Getting error like Can't find any provider when trying to generate report using command line #243

Closed sildisha-bacancy closed 4 years ago

sildisha-bacancy commented 4 years ago

first I run the phpunit testcases using this command ./vendor/bin/phpunit --log-junit ~/phpunit/junit.xml tests

then after i run this all command export CODACY_PROJECT_TOKEN=myprojecttoken export CODACY_API_BASE_URL=http://localhost:8000/:16006 (localhost:8000 is my api server url of local) bash <(curl -Ls https://coverage.codacy.com/get.sh)

but I am getting this type of error... it would be great if anyone suggests the solution. gitissue

github-actions[bot] commented 4 years ago

Internal ticket created : CY-2634

lolgab commented 4 years ago

The script tries to find the provider you are running the script from by analysing the environment variables. Since you are running locally it can't use any CI provider facility to get the commit UUID. So it uses the latest commit on the directory you launch the script in. You can force a particular commit UUID by using the --commit-uuid parameter:

bash <(curl -Ls https://coverage.codacy.com/get.sh) report --commit-uuid YOUR_COMMIT_UUID

I hope this answers your question. Lorenzo

sildisha-bacancy commented 4 years ago

hey, @lolgab thank you for helping me, It is working now. But now I have to configure Codacy with CircleCI but I am not able to understand how to configure it. circleciconfig what i have to write here ?

franciscodua commented 4 years ago

Hi @sildisha-bacancy

I think you're missing two spaces before coverage-reports... and before project_token... (keeping the consistency you have for the other steps). Apart from that, it's exactly like that.

Also, you can use the CircleCI CLI to validate your config file before committing. I find it very useful when changing these files.

franciscodua commented 4 years ago

I'm closing this issue, but please re-open it, or a new one if you still have any questions, problems, or suggestions.