-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add code coverage support using pcov
#1132
Comments
Hi @JesKingDev I completely agree that generating code coverage with PHPUnit using Can you give me more details about how it is implemented in your local development? We can modify the Implementing pcov shouldn't be too difficult, and I'm happy to work on implementing the necessary changes to enable/disable the arguments as needed. |
I don't have much experience with testing and Magento. Is it typical to run Xdebug when running integration tests? That doesn't seem right. I'd think it should always be disabled when tests are executed. Perhaps you meant that with this line:
...that the expected result is to disable Xdebug before the integration results are executed? |
Hi, @JesKingDev. I'm Dosu, and I'm helping the docker-magento team manage their backlog. I'm marking this issue as stale. Issue Summary:
Next Steps:
Thank you for your understanding and contribution! |
Description
Generating code coverage with PHPUnit using
xdebug.mode=coverage
can be incredibly slow and uses a ton of memory (ex. over 8GB in our CI/CD pipelines).pcov
is a more lightweight code coverage solution and is prioritized overxdebug
by PHPUnit since version 7.0.9While
xdebug
andpcov
are not compatible, it's straightforward to pass the arguments to enable/disable when needed. Testing in my local environment showed a 75% decrease in both time and memory usage for integration tests.Steps To Reproduce
xdebug.mode=coverage
make dev-test-run integration
Expected Result
Code coverage reports can be generated without significantly impacting speed or memory usage.
Actual Result
Running PHPUnit with code coverage results in high memory usage and slow performance - nearly 4 times slower/heavier for integration tests.
The text was updated successfully, but these errors were encountered: