-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[PhpunitBridge] Exit code 1 instead of 0 using "quiet" option in 6.1.0 #46497
Comments
What output do you get when omitting the |
When I remove the I just added a simple reproducer to the issue description if you can have a look :) |
Same is happening for our team. After upgrading to |
Related: while I still have |
Would someone be able to create a PR with a failing test? |
@xabbuh Hey Christian, would the failing test above help out a bit more? However, I'm surprised that the |
The problem was introduced in #45923 , before that PR |
@HypeMC I think the failing behavior then is fine actually. When The actual problem (for me) is, that also the behavior of the
It does not (#46651). Is it because when the |
@PythooonUser It's related, the |
@nicolas-grekas Since you have reviewed #45923, do you think the fix in that PR breaks BC, since |
Hello, Long time without response so I will mention you @nicolas-grekas and @greg0ire as you reviewed the mentionned PR, just in case. I was about to open an issue about this behavior too and found this one and came to the same conclusion: the bug was introduced by #45923. We just updated to Symfony 5.4.18. Setting Thank you. |
Sorry, which mentioned PR did I review? |
Woops... I may have confused different tabs 😬 |
Hey, thanks for your report! |
Friendly reminder that this issue exists. If I don't hear anything I'll close this. |
Hi everybody, just a reminder that this is still happening I've just updated my code to 6.3 and my jenkins has started to fail because of deprecations in the code while it didn't with symfony 5.4 and PHPUnit 10.3. I've read some posts about this problem (such as #49069) but not a clear solution found. |
Done a bit higher, 21st june last year 😬, so we are trying other ways as none of us seems to understand properly how it should behave, how to fix or what's going wrong. If the fix is to update the documentation, I can take care of that. |
Also the issue may have been introduced by #48787 and the right person to mention is @ogizanagi ? I hope to not make a mistake by involving another person. Thank you Sorry for double posting. |
I think the verbosity level should govern the output and only that. That is what I would expect without reading any docs. |
I agree. But the exit code still has changed. Should it have been considered a BC break? |
I think a documentation update might be cool, since this is not obvious. As for whether it is a breaking change, it's harder to argue when there are no docs. Maybe it initially behaved like I just described, who knows? |
I will try to make a pr to the doc by the end of the week. The harder for me will be to know how to explain this and how to write it... In english. 😅 Thanks, Gregoire. 🙂 |
No need to overthink it 🙂 a note with the following should suffice:
In terms of UX, I'm starting to think that a |
The only thing I can do about this nice change (to me too at least) would be to open a dedicated issue. 😇 |
Well that would be something already 👍 |
I might not understand well the issue here yet, but the docs states :
#48787 didn't mean to change anything regarding this ; any deprecation by default should make the tests fail and exit So, when using: SYMFONY_DEPRECATIONS_HELPER="quiet[]=indirect&quiet[]=other" the behavior, to me, should be an exit code of SYMFONY_DEPRECATIONS_HELPER="max[total]=9999&quiet[]=indirect&quiet[]=other" #48787 aimed to show verbose output only for the types of deprecation reaching a threshold, instead of showing the verbose output for all of the types. So when using: SYMFONY_DEPRECATIONS_HELPER="max[direct]=0&max[self]=0&max[indirect]=10&max[total]=999999&quiet[]=indirect I'd expect
➜ So, I think @PythooonUser got it right regarding this:
But the behavior of the Though, considering this, there is no way to totally hide verbose output for specific deprecation types as soon as the threshold is reached. But would it make sense anyway ? If your threshold is reached, you probably want to get the maximum information about it and how to solve it (or reconsider the threshold if no solution is applicable to your codebase) |
Ah I didn't know that
I can't imagine a situation where you would want to hide that valuable piece of information. I think this can be closed or transferred to |
And the fix may have introduced the break with the existing code. (only supposition, it will be hard to know where, when and how the behavior has changed and I would be the least qualified to point the line) I think this issue can be closed too. I will try to make a pr by the end of the week on the doc to make the difference between Thanks both of you for the investigations and explanations. :-) |
This PR was squashed before being merged into the 5.4 branch. Discussion ---------- Clearer difference with max and quiet options Hello, First contribution here so I hope that I didn't made a mistake. Let me know if I need to change or point a process I missed. As discussed on the symfony/symfony#46497, the difference between `quiet` and `max` may be unclear. In addition the behavior existing before 5.4 might have been erroneous. As the change is hard to retrieve and impossible to fix now, we come to the conclusion that a doc update may help to fix end user issue with this change. Let me know if the added paragraph needs to be clearer or at another place or if it needs to be rephrased as English is not my first language. I also wanted to make a link to the section which talk about `max` and making tests fail. I hope this is the right way. Thanks for reading. :-) Commits ------- fa31e93 Clearer difference with max and quiet options
Sorry I missed #46497 (comment) and I'm late on the last mention. If this was introduced in #45923 or, in general, as part of the ignoreFile implementation, well that was certainly not intentional. I'll try to catch up with the comments here and look into the code if I can figure out anything. |
Symfony version(s) affected
6.1.0
Description
Hi,
I'm using this configuration for the Phpunit Bridge:
SYMFONY_DEPRECATIONS_HELPER="quiet[]=indirect&quiet[]=other"
Using Symfony 6.0.x I get a
0
exit code, however with Symfony 6.1.0 I get a1
exit code.How to reproduce
SYMFONY_DEPRECATIONS_HELPER="quiet[]=indirect&quiet[]=other"
echo $?
should return0
but returns1
[Edit] Added a simple reproducer here: https://github.com/jmsche/symfony-deprecation-reproducer
To reproduce using the reproducer:
Possible Solution
No response
Additional Context
The only way I managed to get a
0
exit code is to setSYMFONY_DEPRECATIONS_HELPER="disabled=1"
, using the newlogFile
option makes PHPUnit return1
as well.The text was updated successfully, but these errors were encountered: