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

Static tests in Windows fail due to file path mismatches #9805

Closed
barbazul opened this issue May 31, 2017 · 1 comment
Closed

Static tests in Windows fail due to file path mismatches #9805

barbazul opened this issue May 31, 2017 · 1 comment
Labels
Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@barbazul
Copy link
Contributor

Current out of the box Magento2 does not pass static tests in Windows.

Most static integrity tests failures come from [path]\dev\tests\static\testsuite\Magento\Test\Integrity\ClassesTest.php, a file that is explicitely skipped in such tests only the skip mechanism fails under Windows due to paths not maching the exclusion condition

Preconditions

  1. Windows 10
  2. PHP 5.6
  3. Out of the box Magento2 installation

Steps to reproduce

  1. php bin\magento dev:tests:run static

Expected result

  1. Tests pass

Actual result

I am provinding some example failures

  1. Magento\Test\Integrity\ClassesTest::testClassReferences
    Passed: 16807, Failed: 1, Incomplete: 0, Skipped: 0.
    Data set: C:/magento2/dev/tests/static/testsuite/Magento/Test/Integrity/ClassesTest.php
    Incorrect namespace usage(s) found in file C:/magento2/dev/tests/static/testsuite/Magento/Test/Integrity/ClassesTest.php:
    Foo
    Exception
    C:\magento2\dev\tests\static\testsuite\Magento\Test\Integrity\ClassesTest.php:600
    C:\magento2\dev\tests\static\testsuite\Magento\Test\Integrity\ClassesTest.php:373
    C:\magento2\vendor\magento\framework\App\Utility\AggregateInvoker.php:56
    C:\magento2\dev\tests\static\testsuite\Magento\Test\Integrity\ClassesTest.php:376
    C:\magento2\vendor\magento\framework\App\Utility\AggregateInvoker.php:115
    C:\magento2\vendor\magento\framework\App\Utility\AggregateInvoker.php:70
    C:\magento2\dev\tests\static\testsuite\Magento\Test\Integrity\ClassesTest.php:376

  2. Magento\Test\Integrity\ClassesTest::testCoversAnnotation
    Nonexistent classes/methods were found in @Covers annotations:
    C:/magento2/dev/tests/static/testsuite/Magento/Test/Integrity/ClassesTest.php: @Covers annotations
    C:\magento2\dev\tests\static\testsuite\Magento\Test\Integrity\ClassesTest.php:619

There are probably other cases.

In both cases I managed to make the tests pass by hacking the path being compared (like trimming the base path from the begining of the string or replacing \ with /).

I will try to work on a less hacky solution and provide a PR as soon as possible, but I thought reporting it might help someone like me struggling with the static tests in windows in the meantime

@magento-team magento-team added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development develop labels Jul 31, 2017
@magento-team
Copy link
Contributor

Internal ticket to track issue progress: MAGETWO-69868

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

2 participants