-
Notifications
You must be signed in to change notification settings - Fork 12
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
Code coverage cannot be generated due to weird global CSS output #692
Comments
My hunch is that the way Code coverage is basically walking through files and checking if the lines have been executed during the test run (a lot more complex than that but in essence 😅), and when it comes to the view files, and sees the Still not sure where the CSS output comes out tbh. The interim solution is to add <coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
<exclude>
<directory>./src/Blocks/components</directory>
<directory>./src/Blocks/custom</directory>
<directory>./src/Blocks/wrapper</directory>
</exclude>
<report>
<clover outputFile="tests/coverage/clover.xml"/>
<html outputDirectory="tests/coverage/html" lowUpperBound="50" highLowerBound="90"/>
</report>
</coverage> in the The real fix is... Not simple. I recon the fix could be to add a proper 'loader' for view files where the But this would require a careful rewrite of component and block loading in the eightshift-libs, plus all the blocks should be updated (to replace the 'magic' global variables appearing out of nowhere). The positive could be that we might be able to cache some things (global manifest, etc.) and could have some performance gains. |
Describe your bug
When using wp-pest to write integration tests, when checking the code coverage I get the following output:
And no coverage gets generated
Steps to Reproduce
XDEBUG_MODE=coverage ./vendor/bin/pest --group=integration --coverage
Expected behavior
I should get code coverage as in regular Pest tests.
Screenshots, screen recording, code snippet
No response
Environment info
Please confirm that you have searched existing issues in this repo.
Yes
Please confirm that you have searched in our documentation and couldn't find the answer.
Yes
Please confirm that your bug occurs with all plugins uninstalled and with the default WordPress theme active.
Yes
The text was updated successfully, but these errors were encountered: