Skip to content
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

Provide a way to stop execution at a particular deprecation #5954

Open
nicolas-grekas opened this issue Sep 18, 2024 · 2 comments
Open

Provide a way to stop execution at a particular deprecation #5954

nicolas-grekas opened this issue Sep 18, 2024 · 2 comments
Assignees
Labels
feature/test-runner CLI test runner type/enhancement A new idea that should be implemented
Milestone

Comments

@nicolas-grekas
Copy link
Contributor

Deprecation are sometimes hard to track. Figuring the exact stack trace for one particular deprecation is really useful to understand how it comes up and fix it.

It would be awesome to have a command line option (or similar) to tell phpunit to stop and display its stacktrace when a specific deprecation occurs. The match would happen by checking the deprecation message.

For example:

phpunit --stop-on-deprecation="part of the deprecation message"

For sinpiration this capability exists when using Symfony's phpunit-brigde, as documented at https://symfony.com/doc/current/components/phpunit_bridge.html#configuration

@nicolas-grekas nicolas-grekas added the type/enhancement A new idea that should be implemented label Sep 18, 2024
@nicolas-grekas nicolas-grekas changed the title Provide a way to so execution at a particular deprecation Provide a way to stop execution at a particular deprecation Sep 18, 2024
@sebastianbergmann sebastianbergmann added the feature/test-runner CLI test runner label Sep 18, 2024
@sebastianbergmann
Copy link
Owner

sebastianbergmann commented Sep 18, 2024

Is this not two separate things?

  • Display full stack trace (without frames from PHPUnit and its dependencies) for deprecations
  • Support --stop-on-deprecation="part of the deprecation message"

@nicolas-grekas
Copy link
Contributor Author

It could be, but displaying stacktraces for deprecations standalone is not useful nor actionable: deprecations are best reported grouped, which means without stacktraces. One the other side, stopping on one specific deprecation without the stacktrace just asking to run the command again to make it display the stacktrace. Thus combined behavior is the most useful and actionable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/test-runner CLI test runner type/enhancement A new idea that should be implemented
Projects
None yet
Development

No branches or pull requests

2 participants