-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[PHPUnitBridge] When only ignoreFile is passed in SYMFONY_DEPRECATIONS_HELPER, deprecations no longer fail tests #45919
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
Comments
Doesn't #45921 also fix this? |
Actually, this could well be working as designed. When you do not set any SYMFONY_DEPRECATIONS_HELPER variable, the bridge ends up configured by symfony/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php Lines 268 to 270 in cfd44fb
which is essentially as if configuring with But when you pass a
which in turn sets the thresholds to 999999 in symfony/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Configuration.php Lines 97 to 101 in f97db87
So, either we change the default threshold from 999999 to 0 to make 'strict' reporting the default when SYMFONY_DEPRECATIONS_HELPER is set but does not specifically set thresholds (but that will impact live testing, potentially), or we document that if you move from no use of SYMFONY_DEPRECATIONS_HELPER to using it to indicate the ignoreFile, then you also need to specifically set the |
Good catch. That's a bug to me. Not setting any |
OK then, let's change the default. |
Symfony version(s) affected
6.1.0
Description
When only
ignoreFile
is passed inSYMFONY_DEPRECATIONS_HELPER
, deprecations no longer fail tests, unless you also specifically setmax[total]=0
How to reproduce
Use an env var like (from phpunit.xml)
<env name="SYMFONY_DEPRECATIONS_HELPER" value="ignoreFile=/var/www/d10/core/deprecation-ignore.txt"/>
Run tests that have unignored deprecations reported;
The exit code of PHPUnit is 0, not 1 as you would expect.
Add
max[total]=0
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[total]=0&ignoreFile=/var/www/d10/core/deprecation-ignore.txt"/>
Rerun tests;
The exit code of PHPUnit is 1.
Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: