magento-cloud-docker icon indicating copy to clipboard operation
magento-cloud-docker copied to clipboard

Add additional options for PCOV

Open aepod opened this issue 4 years ago • 5 comments

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.

aepod avatar Apr 14 '20 13:04 aepod

@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?

YPyltiai avatar Apr 22 '20 16:04 YPyltiai

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

aepod avatar Apr 23 '20 12:04 aepod

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.

aepod avatar Apr 23 '20 12:04 aepod

@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?

arhiopterecs avatar Sep 24 '20 04:09 arhiopterecs

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

choussamaster avatar Dec 12 '22 17:12 choussamaster