-
-
Notifications
You must be signed in to change notification settings - Fork 616
DX: disable Xdebug by default and provide a CLI option to activate it #1560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
acoulton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is super helpful, thanks ❤️
|
This broke phpstorm's behat debug run. You should consider reverting it. |
|
@ostrolucky can you provide more details? |
|
@ostrolucky You should be able to edit the Behat run configuration to add the |
|
Yeah that seems better than having to define BEHAT_ALLOW_XDEBUG=1 env variable. However, this stuff needs to be done each time you are debugging, or define it as default for behat configuration (which is going to defeat the purpose of making this optional). In any case it's quite non-transparent and different from other test runners like phpunit. I think behat should do it the same way as phpunit. Otherwise we need to reach out to jetbrains to update their IDE, so that this works out of the box like it should. |
|
Thanks @ostrolucky if you feel that there is a better way to handle this, feel free to open an issue in this repository with your suggestion and we will consider it. Or, even better, submit a PR 😄 |
|
Spent most of yesterday fighting my environment, getting highly annoyed that debugging had broken for us. I was at point of scouring the Jetbrains issue tracker and manually debugging their behat helper scripts. Then I found that our renovate run had brought in a point release of behat that has this (workflow breaking) change in it. Our PHPStorm test configs only ever enabled debugging if you requested it so we didn't see any unnecessary slowdown. We've now implemented the test runner flag in the configs and are back to normal. It's a good feature, I just wish it hadn't appeared as it did and been made the default operation. |


If you have been debugging your code with Xdebug and forget to turn it off, when running Behat it can be 2-3 times slower, even if you don't set any breakpoints or actually use Xdebug. Following what other tools like PHPStan or Rector do, with this PR by default we disable Xdebug when running Behat. We add a new
--xdebugcommand line option that allows you to run Behat without disabling Xdebug.This uses the https://github.com/composer/xdebug-handler library, also used by PHPStan and Rector to provide this same functionality