Add WP_CLI_TEST_XDEBUG environment variable for step debugging in Behat tests#289
Add WP_CLI_TEST_XDEBUG environment variable for step debugging in Behat tests#289
Conversation
…ugging in Behat tests Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
@BrianHenryIE wanna test this one? |
|
I took a look at using For visual: Full xdebug_info output (expand)Partial xdebug_info output: It accepts a % php -r "print_r(xdebug_info('mode'));"
Array
(
[0] => develop
)% XDEBUG_MODE=debug php -r "print_r(xdebug_info('mode'));"
Array
(
[0] => debug
)It seems there is only No tests in xdebug/xdebug suggested any other valid values. I wrote the code to allow specifying the But after reading a bit more I don't know if it's worthwhile: https://xdebug.org/docs/all_settings#idekey
https://www.jetbrains.com/help/phpstorm/configuring-xdebug.html#updatingPhpIni
I've still to actually run the code to test it but it reads like how I remember doing it before. TODO:
|
Personally I'd want separate options, to have more flexibility and not accidentally slow down my whole test suite if I want to only debug the test runner and not the commands executed by it.
Should be reasonable to support only Xdebug 3 |
Adds support for enabling Xdebug step debugging when running Behat tests, allowing developers to debug the actual WP-CLI + WordPress code executed during tests.
Changes:
running_with_xdebug()method inFeatureContext.php(mirrors existingrunning_with_code_coverage()pattern)XDEBUG_MODE,XDEBUG_SESSION,XDEBUG_CONFIG) for spawned WP-CLI processes when enabledUsage:
Closes #257
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/0ca86845ce43291e8f5692c7356fccf3bcf02bf4/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/n1bEHN /usr/bin/composer install(http block)https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/845eb62303d2ca9b289ef216356568ccc075ffd1/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/n1bEHN /usr/bin/composer install(http block)https://api.github.com/repos/phpstan/extension-installer/zipball/85e90b3942d06b2326fba0403ec24fe912372936/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/SUkeBE /usr/bin/composer install(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/n1bEHN /usr/bin/composer install(http block)https://api.github.com/repos/phpstan/phpstan/zipball/2770dcdf5078d0b0d53f94317e06affe88419aa8/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/n1bEHN /usr/bin/composer install(http block)https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/n1bEHN /usr/bin/composer install(http block)https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/n1bEHN /usr/bin/composer install(http block)https://api.github.com/repos/symfony/translation-contracts/zipball/65a8bc82080447fae78373aa10f8d13b38338977/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/SUkeBE /usr/bin/composer install(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/n1bEHN /usr/bin/composer install(http block)https://api.github.com/repos/symfony/yaml/zipball/6c84a4b55aee4cd02034d1c528e83f69ddf63810/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/SUkeBE /usr/bin/composer install(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/n1bEHN /usr/bin/composer install(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.