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

Test directory is inconstant #268

Closed
mikeymike opened this issue Apr 7, 2017 · 7 comments
Closed

Test directory is inconstant #268

mikeymike opened this issue Apr 7, 2017 · 7 comments

Comments

@mikeymike
Copy link

Generally M2 modules conform to a pretty rigid structure (albeit not enforced in any way) and one part of this is the test directory.

All modules have them defined as Test and by calling it tests here you're causing the di compile command to compile the tests too.

Here's the line that makes it skip the Test directory https://github.com/magento/magento2/blob/develop/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php#L228-L230

Note that you want actually see any errors under normal conditions but because we've replaced the ancient version of PHPUnit used by Magento2 with PHPUnit 6 we've also lost the PHPUnit_Framework_TestCase class so the DI compile errors for us.

It's clear anyway that tests shouldn't be compiled so I think we should rename the directory to conform 😄

@victor-v-rad
Copy link
Collaborator

Hi @mikeymike

Thank you for posting this issue with good details. Internal ticket MAGETWO-67324 to solve it.

@mikeymike
Copy link
Author

No problem @victor-v-rad .... I'd submit a PR but I'm unsure of the testing procedure for the package. Do the tests run through a core Magento test suite ?

@victor-v-rad
Copy link
Collaborator

The tool is independent from Magento 2 in regards to tests. The right solution is unclear for now because the tool is not an ordinary module of Magento 2. Its directory structure more like any other libs in vendor directory
dirstructure

@mikeymike
Copy link
Author

Understood, I'm familiar with how this is generally done within community packages although I'm unsure of why this wouldn't be seen as an ordinary module of Magento 2? Is there any other context this would be run in other than being a module ?

Either way do you think the better solution is to change the check inside Magento ? It should be a relatively simple fix with no real impact on anything else afaik.

@victor-v-rad
Copy link
Collaborator

You could just delete 'tests' folder if not used.

@mikeymike
Copy link
Author

Yup, we're doing it on a post install script with composer. Thanks though 👍

@mikeymike
Copy link
Author

magento/magento2#9210

This looks like it's solved just awaiting release 👍 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants