From e3890a588ac27dae19caa95325fd4f594fdaaa6d Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Mon, 10 Aug 2020 14:35:08 -0500 Subject: [PATCH 1/4] MCLOUD-6634: Add Magento 2.4.0 and PHP 7.4 support for FT magento-cloud-components --- .travis.yml | 7 +++++- .../Acceptance/Acceptance73Cest.php | 25 +++++++++++++++++++ Test/Functional/Acceptance/AcceptanceCest.php | 25 +++++++++++-------- tests/travis/functional.sh | 3 +++ 4 files changed, 48 insertions(+), 12 deletions(-) create mode 100644 Test/Functional/Acceptance/Acceptance73Cest.php diff --git a/.travis.yml b/.travis.yml index 861d064..0b501da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ language: php php: - '7.1' - '7.2' - - '7.3' + - '7.4' env: - TEST_SUITE=functional @@ -38,6 +38,11 @@ jobs: php: '7.3' env: - TEST_SUITE=static-unit + - script: ./tests/travis/static-unit.sh; + php: '7.4' + dist: bionic + env: + - TEST_SUITE=static-unit install: - composer config github-oauth.github.com ${GITHUB_TOKEN} diff --git a/Test/Functional/Acceptance/Acceptance73Cest.php b/Test/Functional/Acceptance/Acceptance73Cest.php new file mode 100644 index 0000000..d9097d1 --- /dev/null +++ b/Test/Functional/Acceptance/Acceptance73Cest.php @@ -0,0 +1,25 @@ + '2.3.3'], + ['magentoVersion' => '2.3.5'], + ]; + } +} diff --git a/Test/Functional/Acceptance/AcceptanceCest.php b/Test/Functional/Acceptance/AcceptanceCest.php index 859e083..0024da7 100644 --- a/Test/Functional/Acceptance/AcceptanceCest.php +++ b/Test/Functional/Acceptance/AcceptanceCest.php @@ -8,7 +8,7 @@ namespace Magento\CloudComponents\Test\Functional\Acceptance; /** - * @group php73 + * @group php74 */ class AcceptanceCest { @@ -49,7 +49,7 @@ protected function prepareTemplate(\CliTester $I, string $magentoVersion): void public function testPatches(\CliTester $I, \Codeception\Example $data): void { $this->prepareTemplate($I, $data['magentoVersion']); - $this->removeESIfExists($I); + $this->removeESIfExists($I, $data['magentoVersion']); $I->runEceDockerCommand('build:compose --mode=production'); $I->runDockerComposeCommand('run build cloud-build'); $I->startEnvironment(); @@ -62,18 +62,21 @@ public function testPatches(\CliTester $I, \Codeception\Example $data): void /** * @param \CliTester $I + * @param string $magentoVersion */ - protected function removeESIfExists(\CliTester $I): void + protected function removeESIfExists(\CliTester $I, string $magentoVersion): void { - $services = $I->readServicesYaml(); + if ($magentoVersion !== 'master' && version_compare($magentoVersion, '2.4.0', '<')) { + $services = $I->readServicesYaml(); - if (isset($services['elasticsearch'])) { - unset($services['elasticsearch']); - $I->writeServicesYaml($services); + if (isset($services['elasticsearch'])) { + unset($services['elasticsearch']); + $I->writeServicesYaml($services); - $app = $I->readAppMagentoYaml(); - unset($app['relationships']['elasticsearch']); - $I->writeAppMagentoYaml($app); + $app = $I->readAppMagentoYaml(); + unset($app['relationships']['elasticsearch']); + $I->writeAppMagentoYaml($app); + } } } @@ -83,7 +86,7 @@ protected function removeESIfExists(\CliTester $I): void protected function patchesDataProvider(): array { return [ - ['magentoVersion' => '2.3.3'], + ['magentoVersion' => '2.4.0'], ['magentoVersion' => 'master'], ]; } diff --git a/tests/travis/functional.sh b/tests/travis/functional.sh index a0d12a1..e171c88 100755 --- a/tests/travis/functional.sh +++ b/tests/travis/functional.sh @@ -16,4 +16,7 @@ case $TRAVIS_PHP_VERSION in 7.3) ./vendor/bin/codecept run -g php73 --steps ;; + 7.4) + ./vendor/bin/codecept run -g php74 --steps + ;; esac From 619701101977219993daa2decd634b1f567fe341 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Mon, 10 Aug 2020 14:42:12 -0500 Subject: [PATCH 2/4] MCLOUD-6634: Add Magento 2.4.0 and PHP 7.4 support for FT magento-cloud-components --- .travis.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0b501da..6e3bb87 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,13 +11,6 @@ services: - docker language: php -php: - - '7.1' - - '7.2' - - '7.4' - -env: - - TEST_SUITE=functional stages: - static-unit @@ -43,6 +36,21 @@ jobs: dist: bionic env: - TEST_SUITE=static-unit + - stage: test + php: '7.1' + env: + - TEST_SUITE=functional + - php: '7.2' + env: + - TEST_SUITE=functional + - php: '7.3' + env: + - TEST_SUITE=functional + - php: '7.4' + dist: bionic + env: + - TEST_SUITE=functional + install: - composer config github-oauth.github.com ${GITHUB_TOKEN} From 831b4264b463875299dcf9b387843ab05c508f3b Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Mon, 10 Aug 2020 15:59:53 -0500 Subject: [PATCH 3/4] MCLOUD-6634: Add Magento 2.4.0 and PHP 7.4 support for FT magento-cloud-components --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8a5493a..f5dfb3f 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "consolidation/robo": "^1.2", "phpmd/phpmd": "@stable", "phpstan/phpstan": "^0.11", - "phpunit/phpunit": "^6.2", + "phpunit/phpunit": "^7.2", "squizlabs/php_codesniffer": "^3.0" }, "config": { From c2f3a08dc0db1d53d50f5b47700de74351898534 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Tue, 11 Aug 2020 09:40:17 -0500 Subject: [PATCH 4/4] MCLOUD-6634: Add Magento 2.4.0 and PHP 7.4 support for FT magento-cloud-components --- .travis.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6e3bb87..74d7c76 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,11 +31,6 @@ jobs: php: '7.3' env: - TEST_SUITE=static-unit - - script: ./tests/travis/static-unit.sh; - php: '7.4' - dist: bionic - env: - - TEST_SUITE=static-unit - stage: test php: '7.1' env: