magento / magento-cloud-docker

All Submissions you make to Magento Inc. (“Magento") through GitHub are subject to the following terms and conditions: (1) You grant Magento a perpetual, worldwide, non-exclusive, no charge, royalty free, irrevocable license under your applicable copyrights and patents to reproduce, prepare derivative works of, display, publically perform, sublicense and distribute any feedback, ideas, code, or other information (“Submission") you submit through GitHub. (2) Your Submission is an original work of authorship and you are the owner or are legally entitled to grant the license stated above. (3) You agree to the Contributor License Agreement found here: https://github.com/magento/magento2/blob/master/CONTRIBUTOR_LICENSE_AGREEMENT.html
Open Software License 3.0
256 stars 191 forks source link

Add additional options for PCOV #196

Open aepod opened 4 years ago

aepod commented 4 years ago

https://github.com/krakjoe/pcov Can be used like xdebug, but is a lot more lightweight.

This will allow phpstorm to run code coverage reports very quickly: https://www.jetbrains.com/phpstorm/whatsnew/#ml-assisted-ranking-for-code-completion

PCOV was already added in an earlier PR, but it is missing the optional flag, and it also needs to not run in the xdebug container. https://github.com/magento/magento-cloud-docker/pull/136

This should be optional, with a flag --with-pcov and additionally, it should be installed into the normal CLI container, so that phpstorm can access.

One note:

interoperability with Xdebug is not possible interoperability with phpdbg is not possible

This means that the two options cannot be used in the same containers, this is ok as we do not run xdebug in the CLI or FPM container, they have their own containers and are routed to from nginx.

YPyltiai commented 4 years ago

@aepod for some reason I recall us adding PCOV already. See: https://github.com/magento/magento-cloud-docker/pull/136 Didn't that work for you?

aepod commented 4 years ago

I missed that, good to go now. Thanks Yev!

aepod commented 4 years ago

Actually: 1) It does not have the logic to not run this in the xdebug container, if this extension loads there it will cause problems. 2) It is not an "optional" extension, should probably not be forced, like xdebug it should be a choice and not run in places like production.

So this Request is going to get changed, to improve these two things.

arhiopterecs commented 4 years ago

@aepod Hi! https://github.com/magento/magento-cloud-docker/issues/196#issuecomment-617897362, pcov extension has already been added. I think that the maximum that can be added here is if you try to enable these two extensions (xdebug and pcov) at the same time, then show a warning that this can lead to problems Do you agree with me?

choussamaster commented 1 year ago

Note that when pcov extension is enabled blackfire profiling is not working correctly anymore, it does not show php path file of inspected scripts.