Skip to content

[New Rule] No imports from static tests namespaces #142

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

Closed
ihor-sviziev opened this issue Sep 24, 2019 · 3 comments
Closed

[New Rule] No imports from static tests namespaces #142

ihor-sviziev opened this issue Sep 24, 2019 · 3 comments
Labels
accepted New rule is accepted

Comments

@ihor-sviziev
Copy link
Collaborator

Rule

I suggest to add one rule that will check that there is no imports from static tests namespaces.

Reason

Time to time we're getting issue with running tests on PRs in magento/magento2 repository because someone imported \Magento\Tests\NamingConvention\true\string by mistake. As result - we have "No build reports available" for "Database Compare build", "Functional Tests build", "Sample Data Tests build" while Static tests are shown as "failing" but in results - we don't really have reason. Example: https://github.com/magento/magento2/runs/214712913

Implementation

Check that all files in all modules do not contains any imports from \Magento\Tests\NamingConvention namespace

@lenaorobei
Copy link
Contributor

As per magento/architecture#290 it was decided to prohibit any Magento\Tests imports in modules.

@konarshankar07
Copy link
Contributor

Hello @lenaorobei ,
What should be the severity and type for this new rule?
Thanks

@lenaorobei
Copy link
Contributor

@konarshankar, severity - 8, type - warning.

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

No branches or pull requests

3 participants