Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[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

Merged
merged 1 commit into from
Jan 30, 2017
Merged

[FrameworkBundle] Revert AbstractDescriptorTest output trimming #21424

merged 1 commit into from
Jan 30, 2017

Conversation

ogizanagi
Copy link
Contributor

@ogizanagi ogizanagi commented Jan 26, 2017

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:

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:

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                              
  ------------------ ---------------------------------'

@chalasr
Copy link
Member

chalasr commented Jan 26, 2017

👍 Didn't think about putenv.

Status: reviewed

@@ -15,6 +15,11 @@

class TextDescriptorTest extends AbstractDescriptorTest
{
protected function setUp()
{
putenv('COLUMNS=121');
Copy link
Member

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

Copy link
Contributor Author

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

Copy link
Member

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

@nicolas-grekas
Copy link
Member

👍

Copy link
Member

@xabbuh xabbuh left a comment

Choose a reason for hiding this comment

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

👍

nicolas-grekas added a commit that referenced this pull request Jan 30, 2017
…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
@fabpot
Copy link
Member

fabpot commented Jan 30, 2017

Thank you @ogizanagi.

@fabpot fabpot merged commit efd00ba into symfony:master Jan 30, 2017
fabpot added a commit that referenced this pull request Jan 30, 2017
…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
@ogizanagi ogizanagi deleted the fix/descriptors_tests_trim branch January 30, 2017 15:55
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.

7 participants