-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
PHP Livecodetest testCodeStyle() method does not use whitelist files #11362
PHP Livecodetest testCodeStyle() method does not use whitelist files #11362
Conversation
It was done intentionally in #8685 and should not be ever changed in order to avoid regression of fixed problem. PHPCS run takes only few minutes while PHPMD would take hours. Behavior of |
Current implementation needs to be changed so that:
|
dev/tests/static/phpunit.xml.dist
Outdated
@@ -30,6 +30,7 @@ | |||
</testsuites> | |||
<php> | |||
<ini name="date.timezone" value="America/Los_Angeles"/> | |||
<env name="phpunit.static.testcodestyle.use_whitelist" value="0"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest changing it to testcodestyle.is_full_scan
and default 1
value.
I'm not sure whether it's better to use env or const, like we do in integration tests <const name="TESTS_CLEANUP" value="enabled"/>
.
@@ -201,11 +201,16 @@ private function getFullWhitelist() | |||
|
|||
public function testCodeStyle() | |||
{ | |||
$useWhiteList = isset($_ENV['phpunit.static.testcodestyle.use_whitelist']) | |||
&& $_ENV['phpunit.static.testcodestyle.use_whitelist'] === '1'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simply $whitelist = !empty(...is_full_scan...) ? ...
Please use both php
and phtml
.
5bfdb38
to
4e9f0db
Compare
ad84856
to
205c2f9
Compare
@vrann I updated this PR to include new const also in phpunit-all.xml.dist file, and add comments, could you check the commit associated to this PR? 205c2f9 The one added in MAGETWO-81646 - bf50355 does not include the last changes, and due to this, conflicts have raised: https://github.com/magento/magento2/pull/11362/conflicts. |
@adrian-martinez-interactiv4 it cannot be reverted, please apply these additional changes on top of new |
…ed in phpunit xml config file
205c2f9
to
22fd782
Compare
@orlangur Done |
Somehow it is not passing on Bamboo currently, I need some time to find out why. No action required from your side, just some patience :) |
@ihor-sviziev it is just a workaround, I need to find out how such changes broke the Bamboo CICD loop. |
…hitelist files #11362 - revert workaround
Description
\Magento\Test\Php\LiveCodeTest::testCodeStyle method does not use whitelist files, as it does \Magento\Test\Php\LiveCodeTest::testCodeMess. Because of that, it takes ages to complete when you only want to test code style for a few modified files.
With proposed changes, it will try to find whitelisted files, and if it does not find any, then full whitelist will be checked. By default the behaviour is the same, as long as you have the ability to limit processed files if you create whitelist files from outside.
Fixed Issues (if relevant)
Improvement
Manual testing scenarios
Contribution checklist