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

Removed FileClassScannerTest dependency to "Magento_Catalog" #12144

Merged
merged 1 commit into from
Nov 10, 2017
Merged

Removed FileClassScannerTest dependency to "Magento_Catalog" #12144

merged 1 commit into from
Nov 10, 2017

Conversation

wexo-team
Copy link

@wexo-team wexo-team commented Nov 9, 2017

Description

Code optimization that makes a current test testClassKeywordInMiddleOfFile stand on its own since is the only test in FileClassScannerTest to not include its own test data.

Process

Looked at the original error fixed by 4e8d1d6 and reproduced what it needed from app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/AbstractEav.php
to test for the problem "FileClassScannerTest not liking one case when the word "class" was in a class" as described in commit message 4e8d1d6. Found the problem to only be triggered when string variable interpolation was also being used in the class.
On this basis, the name of the test was changed to testMultipleClassKeywordsInMiddleOfFileWithStringVariableParsing

Motivation behind this change came from experiencing the issue #11230

To test this code

  1. git checkout 4e8d1d612a98cbe35e7782faba5c0609935a1c2a~1
  2. composer install
  3. Insert new method \Magento\Setup\Test\Unit\Module\Di\Code\Reader\FileClassScannerTest::testMultipleClassKeywordsInMiddleOfFileWithStringVariableParsing() found in 6cf723a945fe7e490fc223b8092ffdc8e3dff910 (the commit from this pull requst) into setup/src/Magento/Setup/Test/Unit/Module/Di/Code/Reader/FileClassScannerTest.php
  4. Run the unit test to see that it fails as expected (example ./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist --filter testMultipleClassKeywordsInMiddleOfFileWithStringVariableParsing setup/src/Magento/Setup/Test/Unit/Module/Di/Code/Reader/FileClassScannerTest.php)

Fixes Issue

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

Looked at the original error fixed by 4e8d1d6 and reproduced
what it needed from app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/AbstractEav.php
to test for "FileClassScannerTest not liking one case when the word "class" was in a class"
@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Nov 9, 2017

CLA assistant check
All committers have signed the CLA.

@magento-engcom-team magento-engcom-team added the Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch label Nov 9, 2017
@wexo-team
Copy link
Author

wexo-team commented Nov 9, 2017

@magento-engcom-team can you provide info about how this got the label "Cannot Reproduce"?

@okorshenko okorshenko removed the Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch label Nov 9, 2017
@dmanners
Copy link
Contributor

dmanners commented Nov 9, 2017

@wexo-team the label has been copied from a linked issue. It has been removed now.

@okorshenko okorshenko self-assigned this Nov 9, 2017
@okorshenko okorshenko added this to the November 2017 milestone Nov 9, 2017
@okorshenko okorshenko merged commit e046aad into magento:2.2-develop Nov 10, 2017
@wexo-team wexo-team deleted the issue/file-class-scanner-test-content branch November 10, 2017 10:08
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