Skip to content

Enhance deprecation summary at end of tests #13279

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

Merged
merged 1 commit into from
Jan 7, 2015

Conversation

nicolas-grekas
Copy link
Member

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

Splits deprecations triggered by legacy tests and non-legacy ones.

}
register_shutdown_function(function () use (&$deprecations, $deprecationHandler) {

if (function_exists('posix_isatty') && @posix_isatty(STDOUT)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about Windows users with ConEmu (I care less than previously though as I'm not running tests on Windows anymore and this is only about the testsuite, but it would be handy) ?

Btw, isn't it possible to get this info from PHPUnit itself (using colors if PHPUnit is using colors) ?

@stof
Copy link
Member

stof commented Jan 6, 2015

Regarding the remaining violations, I think Symfony\Component\Validator\ConstraintValidator::buildViolation should not trigger a violation. The goal of this method is to make it easy to support both validation APIs in validators (avoiding duplication), so we are not planning to drop its usage in 2.7. Btw, this method could be kept in 3.0 without much harm (as a direct proxy to the similar method in the new execution context)

Should legacy deprecation warnings be reported at all ? We expect to call deprecated APIs in this case. And your handler does not seem to check whether the error reporting level is asking to ignore them or no. I think most of the legacy tests are explicitly ignoring deprecations

@nicolas-grekas
Copy link
Member Author

Updated: I now use the color support detection from phpunit (but not the command line argument, I don't want to dig too deep into the source code to find how).
I also reduced the size of the summary for legacy tests (but it's too early to remove it now imo).

@stof
Copy link
Member

stof commented Jan 6, 2015

@nicolas-grekas can you make sure that all legacy tests being reported are only the legacy tests which don't have the iniSet ? I'm not sure about it

@nicolas-grekas
Copy link
Member Author

@stof I don't check if iniSet has been called or not but I'll do it now, thanks for the reminder :)

@stof
Copy link
Member

stof commented Jan 6, 2015

I think you need to add a error_reporting() & E_USER_DEPRECATED check in the condition deciding to handle the error or to forward to the next handler

@nicolas-grekas
Copy link
Member Author

Ready: I check error_reporting() & E_USER_DEPRECATED but only for legacy tests

@stof
Copy link
Member

stof commented Jan 7, 2015

@nicolas-grekas why ? If the error_reporting asks to ignore them (or if they are silenced by @), the error handler should respect it IMO

@nicolas-grekas
Copy link
Member Author

That's not because you use a deprecated method but @-silenced it that you should not see the notice inviting you to update your code. This is how the Debug\ErrorHandler works btw: error_reporting() is ignored for deprecated notices and they are always logged. And this is a Good Thing (c)

@fabpot
Copy link
Member

fabpot commented Jan 7, 2015

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 7b8cf01 into symfony:2.7 Jan 7, 2015
fabpot added a commit that referenced this pull request Jan 7, 2015
…kas)

This PR was merged into the 2.7 branch.

Discussion
----------

Enhance deprecation summary at end of tests

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Splits deprecations triggered by legacy tests and non-legacy ones.

Commits
-------

7b8cf01 Enhance deprecation summary at end of tests
@nicolas-grekas nicolas-grekas deleted the deprec-summary branch January 7, 2015 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy