-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Revert AbstractDescriptorTest output trimming #21424
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
Conversation
👍 Didn't think about putenv. Status: reviewed |
@@ -15,6 +15,11 @@ | |||
|
|||
class TextDescriptorTest extends AbstractDescriptorTest | |||
{ | |||
protected function setUp() | |||
{ | |||
putenv('COLUMNS=121'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this has a global effect, should be destroyed in teardown to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks. The same should apply to the 3.2 branch and SymfonyStyleTest
. See #21456
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
destroying it means setting it back to its existing value if any, not removing the env var entirely
👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…gizanagi) This PR was merged into the 3.2 branch. Discussion ---------- [Console] SfStyleTest: Remove COLUMNS env on tearDown | Q | A | ------------- | --- | Branch? | 3.2 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #21424 (comment) | License | MIT | Doc PR | N/A Commits ------- b715a36 [Console] SfStyleTest: Remove COLUMN env on tearDown
Thank you @ogizanagi. |
…rimming (ogizanagi) This PR was merged into the 3.3-dev branch. Discussion ---------- [FrameworkBundle] Revert AbstractDescriptorTest output trimming | Q | A | ------------- | --- | Branch? | master | Bug fix? | no, but fixes an annoying/unhelping test output and fixes false positives | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | https://github.com/symfony/symfony/pull/21129/files#diff-0e52187cbf1067a310538287da74ddb5R178 | License | MIT | Doc PR | N/A #### Before output when having a failing test, for instance, in a `TextDescriptor` fixture: ```diff There was 1 failure: 1) Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\TextDescriptorTest::testDescribeContainerDefinitionWhichIsAnAlias with data set #1 (Symfony\Component\DependencyInjection\Alias Object (...), ' // This serv...------', Symfony\Component\DependencyInjection\ContainerBuilder Object (...), array('alias_2')) Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -' // This service is an alias for the service service_2 Information for Service "service_2" =================================== ------------------ --------------------------------- Option Value ------------------ --------------------------------- Class Full\Qualified\Class2 Tags tag1 (attr1: val1, attr2: val2) tag1 (attr3: val3) tag2 Calls setMailer Public no Synthetic yes Lazy no Shared yes Abstract no Autowired no Autowiring Types - Required File /path/to/file Factory Service factory.service Factory Method get ------------------ ---------------------------------' +' // This service is an alias for the service service_2 Information for Service "service_2" =================================== ------------------ --------------------------------- Option Value ------------------ --------------------------------- Service ID service_2 Class Full\Qualified\Class2 Tags tag1 (attr1: val1, attr2: val2) tag1 (attr3: val3) tag2 Calls setMailer Public no Synthetic yes Lazy no Shared yes Abstract no Autowired no Autowiring Types - Required File /path/to/file Factory Service factory.service Factory Method get ------------------ ---------------------------------' ``` #### After: ```diff There was 1 failure: 1) Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\TextDescriptorTest::testDescribeContainerDefinitionWhichIsAnAlias with data set #1 (Symfony\Component\DependencyInjection\Alias Object (...), ' // This serv...------', Symfony\Component\DependencyInjection\ContainerBuilder Object (...), array('alias_2')) Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ ------------------ --------------------------------- + Service ID service_2 Class Full\Qualified\Class2 Tags tag1 (attr1: val1, attr2: val2) tag1 (attr3: val3) tag2 Calls setMailer Public no Synthetic yes Lazy no Shared yes Abstract no Autowired no Autowiring Types - Required File /path/to/file Factory Service factory.service Factory Method get ------------------ ---------------------------------' ``` Commits ------- efd00ba [FrameworkBundle] Revert AbstractDescriptorTest output trimming
Before output when having a failing test, for instance, in a
TextDescriptor
fixture:After: