-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error : No code coverage driver available in PHPunit test #42286
Comments
CC: @andreiglingeanu |
The problem is caused by the gutenberg/packages/env/lib/init-config.js Lines 84 to 90 in d591591
We should either (1) update the logic to apply the |
Thanks @kasparsd. If you have any solution for this, Please do suggest. |
Looks like So we need to update the gutenberg/packages/env/lib/build-docker-compose-config.js Lines 175 to 258 in d591591
|
do you think it because of this command in package.json It is stated that we have pass Xdebug argument along with env command as below. But when we execute npm run test:unit:php command, docker env command executed without xdebug arguments.
|
Today, I spent some time attempting to resolve this issue for a project. In order to generate an HTML coverage report, I added the following commands to my
Run |
@jrtashjian I tried your solution with my docker setup but no luck. coverage report still not generated. |
It appears there are irregularities in how the
I was able to see coverage output. |
Here's an updated solution
By following these steps, you should be able to set up and run PHPUnit tests with code coverage in your project. Once #54508 is merged, you should be able to run the globally available phpunit inside the container. However, PHPUnit advises adding the dependency to your project for better control and compatibility. |
Description
while running PHPUnit test in gutenberg with docker setup, we cant able to generate code coverage report. Looked through all documentation and followed step as provided. still received error of code coverage driver. It must be issue with gutenberg docker image.
Step-by-step reproduction instructions
npm run wp-env start -- --xdebug=develop,coverage
--coverage-text
or--coverage-html
CLI arguments.Screenshots, screen recording, code snippet
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: