Skip to content
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

Error with StdoTest #8315

Closed
dmanners opened this issue Jan 27, 2017 · 8 comments
Closed

Error with StdoTest #8315

dmanners opened this issue Jan 27, 2017 · 8 comments
Labels
bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@dmanners
Copy link
Contributor

dmanners commented Jan 27, 2017

Preconditions

  1. Magento: develop
  2. PHP 7.0.15

Steps to reproduce

  1. Run ./vendor/bin/phpunit --debug -v -c dev/tests/unit/phpunit.xml.dist setup/src/Magento/Setup/Test/Unit/Module/I18n/Dictionary/Writer/Csv/StdoTest.php

Expected result

  1. Assertion to show as all green

Actual result

  1. PHPUnit cannot output anything as it uses the STDOUT stream which has just been destroyed in the teadown of the test.

I am not even 100% if this testing is actually makes sense. But because of the __destruct method in Magento\Setup\Module\I18n\Dictionary\Writer\Csv the output will always be closed and then PHPUnit will fail when trying to write the test results to the screen.

@dmanners
Copy link
Contributor Author

dmanners commented Jan 27, 2017

This also causes the same issue while running the test setup/src/Magento/Setup/Test/Unit/Module/I18n/FactoryTest.php

@dmanners
Copy link
Contributor Author

dmanners commented Jan 27, 2017

If you run phpunit with the --stderr option then this problem will not occur. Is this the desired option here? I mean it works but to me it seems that there could be deeper issues with closing STDOUT that might not be obvious.

Actually that seems to cause issues with the session tests also.

@dmanners
Copy link
Contributor Author

dmanners commented Feb 1, 2017

Is this an obsolete class? I found it referenced in dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php if that is the case can we remove the class or tests?

@schmengler
Copy link
Contributor

"Is this an obsolete class?" I hope so. It can break everything by closing STDOUT...

@okorshenko
Copy link
Contributor

@dmanners thank you for reporting the issue. Internal ticket: MAGETWO-64853

@okorshenko
Copy link
Contributor

@dmanners @schmengler class Magento\Setup\Module\I18n\Dictionary\Writer\Csv is not obsolete. This class replaces removed class Magento\Tools\I18n\Dictionary\Writer\Csv.

The file dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php has the follwing format: [Removed\Class\Name, Class\Name\To\Use]

@orlangur
Copy link
Contributor

If setup/src/Magento/Setup/Test/Unit/Module/I18n/FactoryTest.php really needs to be implemented this way (it is not "unit test" as it implicitly instantiates another object with "bad" destructor) and if Factory implementation really needs to instantiate object directly with new operator like it does currently then the only way to fix it is to create a stub of Writer/Csv/Stdo with not so evil destructor.

@okorshenko, please consider running unit/integration tests with --debug option on daily/weekly basis or as a part of release activity.

mmansoor-magento pushed a commit that referenced this issue Feb 22, 2017
…est/Unit/Module/I18n/Dictionary/Writer/Csv/StdoTest.php crashes in debug mode #8610

 - Merge Pull Request #8610 from orlangur/magento2:fix-test-setup/src/Magento/Setup/Test/Unit/Module/I18n/Dictionary/Writer/Csv/StdoTest.php
mmansoor-magento pushed a commit that referenced this issue Feb 22, 2017
…est/Unit/Module/I18n/Dictionary/Writer/Csv/StdoTest.php crashes in debug mode #8610
@magento-team magento-team added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report develop labels Jul 31, 2017
@magento-team
Copy link
Contributor

Internal ticket to track issue progress: MAGETWO-64462

magento-devops-reposync-svc pushed a commit that referenced this issue Jun 13, 2023
AC-8862: Config path which contains capital letters doesn't return value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

6 participants