You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 over xdebug by PHPUnit since version 7.0.9
While xdebug and pcov 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
Enable xdebug with xdebug.mode=coverage
Run 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:
I completely agree that generating code coverage with PHPUnit using xdebug.mode=coverage can be extremely slow and resource-intensive, especially in CI/CD pipelines.
Can you give me more details about how it is implemented in your local development?
We can modify the bin/xdebug script or create a new bin/pcov script for example to enable/disable pcov.
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:
While xdebug and pcov are not compatible, it's straightforward to pass the arguments to enable/disable when needed.
...that the expected result is to disable Xdebug before the integration results are executed?
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: