magento / catalog-storefront

Open Software License 3.0
7 stars 18 forks source link

ComposetTest fails on blacklisted modules #473

Closed magento-engcom-team closed 3 years ago

magento-engcom-team commented 3 years ago

In scope of work on catalog-storefront project it's reqiured to use specific versions for 3rd party modules https://github.com/magento/storefront-product-reviews-ce/blob/b55d486c510514372703bc369dafcb1fb1f7ba56/app/code/Magento/ReviewsStorefrontApi/composer.json#L10 

"google/protobuf": "3.11",
"grpc/grpc": "1.27",
"spiral/php-grpc": "^1.1"

  Static test fails with the following error:

Magento\Test\Integrity\ComposerTest::testValidComposerJson Passed: 341, Failed: 1, Incomplete: 0, Skipped: 0. Data set: /var/www/html/app/code/Magento/ReviewsStorefrontApi Version must not be specified in the root and package composer JSON files in Git Failed asserting that object of class "stdClass" does not have attribute "version". /var/www/html/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php:270 /var/www/html/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php:195 /var/www/html/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php:96 /var/www/html/lib/internal/Magento/Framework/App/Utility/AggregateInvoker.php:56 /var/www/html/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php:98

ReviewsStorefrontApi module has been blacklisted in dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/composer_root_modules_reviews*ce.txt, despite that ComposerTest still fails, because version check doesn't work with blacklist. It is proposed to make it work with blacklist as well:

     private function assertNoVersionSpecified(\StdClass $json)
    {
        if (!in_array($json->name, self::$rootComposerModuleBlacklist)) {
            $errorMessage = 'Version must not be specified in the root and package composer JSON files in Git';
            $this->assertObjectNotHasAttribute('version', $json, $errorMessage);
        }
    }

the following changes must be reverted from catalog-data-export, been added there as workaround and must be removed after sync with 2.4-develop

magento-engcom-team commented 3 years ago

The issue was exported from the internal JIRA. The link to the original JIRA issue: https://jira.corp.magento.com/browse/SFAPP-188

m2-assistant[bot] commented 3 years ago

Hi @magento-engcom-team. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this