I'm attempting to run a code coverage report on my DDEV site with ./vendor/bin/paratest -p8 --phpunit=./bin/simple-phpunit --coverage-html=public/coverage --coverage-clover=clover.xml
I can turn on xdebug fine with ddev xdebug on
, but then when running the above command I get the Xdebug: [Step Debug] Could not connect to debugging client. Tried: host.docker.internal:9003 (through xdebug.client_host/xdebug.client_port) :-(
error.
I'm on version v1.21.3
of DDEV and this was working previously, so at some point in the last couple of versions this has stopped working for me.
Not sure on the steps to deguv this, so any help is much appreciated!
When you use ddev xdebug on
it enabled xdebug for PHP projects. paratest is a php app, so xdebug tries to connect to your IDE when you run it. You can certainly enable listening on your IDE to solve this if you want step-debugging enabled.
If you don't want step-debugging enabled with what you're doing, try using XDEBUG_MODE=coverage. docs. So maybe you want something like:
ddev exec 'XDEBUG_MODE=coverage paratest -p8 --phpunit=./bin/simple-phpunit --coverage-html=public/coverage --coverage-clover=clover.xml'