Closed ola-mymed closed 4 years ago
Hi @ola-mymed
2020-06-01 14:17:44.157Z error [CodacyCoverageReporter] File /build/coverage-xml/index.xml does not exist. - (CodacyCoverageReporter.scala:25)
That error occurs when the file doesn't exist. So, is it possible that the path is incorrect? Check if build/coverage-xml/index.xml
(without the first /
) exists, since the actions usually use the path relative to the repository root.
When I supply nothing, I get: Can't get any report due to no matching! Try to specify the report with -r.
In the reporter's documentation you can find the following note under the format column PHPUnit XML (version <= 4)
. This means, that the PHPUnit XML format is only supported for PHPUnit version 4 or below. From version 5 and up you should use the clover file format.
Is it possible that you're using a more recent version of PHPUnit?
Let us know if these suggestions helped or if you remain with the same problem.
Thanks @franciscodua but using build/coverage-xml/index.xml
(without the first /) gives this error instead:
error [CodacyCoverageReporter] The provided coverage report /github/workspace/build/coverage-xml/index.xml generated an empty result.
To confirm: I'm using PHPUnit 8.5.
Ok cool.
This means the first problem is solved. The path is now correct.
But the report is not supported by the tool. Because you are using a PHPUnit 8.5, which is more recent than version 4. That's why it's generating empty results, because it doesn't know the document format.
To fix that problem you can instead generate a Clover report and use it instead. To use a clover report you can follow this guide.
Thanks a lot @franciscodua I actually figured that out right after I dropped my last message so I went off to confirm this by creating a clover report in the root of my directory and then supplied this to the 'coverage-reports' param instead. Works a treat now, thanks again!
Great to hear! I'll close this issue then
I'm using PHPUnit 8.5 but can't seem to get my coverage file located at '/build/coverage-xml/index.xml' uploaded.
When I supply that to the 'coverage-reports' param of your action, I get:
When I supply nothing, I get:
Can't get any report due to no matching! Try to specify the report with -r.
Any ideas where I'm going wrong?