diff --git a/.travis.yml b/.travis.yml index 861d064..74d7c76 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,13 +11,6 @@ services: - docker language: php -php: - - '7.1' - - '7.2' - - '7.3' - -env: - - TEST_SUITE=functional stages: - static-unit @@ -38,6 +31,21 @@ jobs: php: '7.3' 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} 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/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": { 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