Skip to content

[PhpUnitBridge] wrong output when trying to quiet deprecations #43371

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

Closed
wants to merge 2 commits into from

Conversation

kbond
Copy link
Member

@kbond kbond commented Oct 8, 2021

Q A
Branch? 5.4
Bug fix? no
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

I've found what I suspect is a bug when trying to display verbose deprecation for some types and hide others. This is a failing test. When using max[self]=0&max[direct]=0&quiet[]=unsilenced&quiet[]=indirect&quiet[]=other I expect everything but self/direct depredations to be hidden. This is not the case.

The actual output of the failing test is as follows:

Unsilenced deprecation notices (3)

  2x: unsilenced foo deprecation
    2x in FooTestCase::testLegacyFoo

  1x: unsilenced bar deprecation
    1x in FooTestCase::testNonLegacyBar

Remaining direct deprecation notices (2)

  1x: root deprecation

  1x: silenced bar deprecation
    1x in FooTestCase::testNonLegacyBar

Remaining indirect deprecation notices (1)

  1x: Since acme/lib 3.0: deprecatedApi is deprecated, use deprecatedApi_new instead.
    1x in SomeService::deprecatedApi from acme\lib

Legacy deprecation notices (2)

@nicolas-grekas
Copy link
Member

Can you figure out the root of the issue? That'd be super helpful :)

@kbond
Copy link
Member Author

kbond commented Dec 6, 2021

I think I narrowed down the root cause.

@@ -34,6 +34,3 @@ require __DIR__.'/fake_vendor/acme/outdated-lib/outdated_file.php';
?>
--EXPECTF--
Remaining indirect deprecation notices (1)
Copy link
Member Author

@kbond kbond Dec 6, 2021

Choose a reason for hiding this comment

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

This test was clearly designed to show the below message even when verbose=0 so I'm guessing my "fix" is wrong but at least (hopefully) better demonstrates the problem: when any of the levels has a failure, all level output is verbose again - even levels that are marked as "quiet" that do not cause a failure.

@nicolas-grekas
Copy link
Member

Closing as this stalled and this didn't get much traction. This might be a too edgy case not really worth investigating :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants