From 5effb8fa74d8c73239e5960cad27c7fc129bee81 Mon Sep 17 00:00:00 2001 From: Lorenzo Ruozzi Date: Mon, 8 Jul 2024 11:48:41 +0200 Subject: [PATCH] Upgrade for Sylius 1.13 --- .github/workflows/build.yml | 22 +++++++------- behat.yml.dist | 45 ++++++++++++++++------------ composer.json | 10 ++++--- tests/Application/config/bundles.php | 7 ++++- 4 files changed, 49 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ee87291..42bc2fc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,11 +21,11 @@ jobs: strategy: fail-fast: false matrix: - php: ["8.0", "8.1"] - symfony: ["5.4.*", "^6.0"] - sylius: ["^1.12"] + php: [ "8.1", "8.2", "8.3" ] + symfony: [ "5.4.*", "^6.4" ] + sylius: ["1.12.16", "1.13.1"] node: ["18.x"] - mysql: ["5.7", "8.0"] + mysql: ["8.0"] env: APP_ENV: test @@ -46,7 +46,7 @@ jobs: - name: Setup Node - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: node-version: "${{ matrix.node }}" @@ -77,6 +77,10 @@ jobs: name: Run webserver run: (cd tests/Application && symfony server:start --port=8080 --dir=public --daemon) + - + name: Validate composer.json + run: composer validate --ansi --strict + - name: Get Composer cache directory id: composer-cache @@ -84,7 +88,7 @@ jobs: - name: Cache Composer - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }} @@ -121,7 +125,7 @@ jobs: - name: Cache Yarn - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ steps.yarn-cache.outputs.dir }} key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/package.json **/yarn.lock') }} @@ -152,10 +156,6 @@ jobs: name: Load fixtures in test application run: (cd tests/Application && bin/console sylius:fixtures:load -n) - - - name: Validate composer.json - run: composer validate --ansi --strict - - name: Validate database schema run: (cd tests/Application && bin/console doctrine:schema:validate) diff --git a/behat.yml.dist b/behat.yml.dist index 0234ca0..561c240 100644 --- a/behat.yml.dist +++ b/behat.yml.dist @@ -3,8 +3,15 @@ imports: - tests/Behat/Resources/suites.yml default: + formatters: + pretty: + verbose: true + paths: false + snippets: false + extensions: DMore\ChromeExtension\Behat\ServiceContainer\ChromeExtension: ~ + Robertfausk\Behat\PantherExtension: ~ FriendsOfBehat\MinkDebugExtension: directory: etc/build @@ -15,32 +22,30 @@ default: files_path: "%paths.base%/vendor/sylius/sylius/src/Sylius/Behat/Resources/fixtures/" base_url: "https://127.0.0.1:8080/" default_session: symfony - javascript_session: chrome_headless + javascript_session: panther sessions: symfony: symfony: ~ - chrome_headless: + chromedriver: chrome: api_url: http://127.0.0.1:9222 validate_certificate: false - chrome: - selenium2: - browser: chrome - capabilities: - browserName: chrome - browser: chrome - version: "" - marionette: null # https://github.com/Behat/MinkExtension/pull/311 - chrome: - switches: - - "start-fullscreen" - - "start-maximized" - - "no-sandbox" - extra_capabilities: + chrome_headless_second_session: + chrome: + api_url: http://127.0.0.1:9222 + validate_certificate: false + panther: + panther: + manager_options: + connection_timeout_in_ms: 5000 + request_timeout_in_ms: 120000 + chromedriver_arguments: + - --log-path=etc/build/chromedriver.log + - --verbose + capabilities: + acceptSslCerts: true + acceptInsecureCerts: true unexpectedAlertBehaviour: accept - firefox: - selenium2: - browser: firefox show_auto: false FriendsOfBehat\SymfonyExtension: @@ -53,3 +58,5 @@ default: FriendsOfBehat\SuiteSettingsExtension: paths: - "features" + + SyliusLabs\SuiteTagsExtension: ~ diff --git a/composer.json b/composer.json index 1e9af79..f475547 100644 --- a/composer.json +++ b/composer.json @@ -8,14 +8,14 @@ ], "license": "MIT", "require": { - "php": "^8.0", + "php": "^8.1", "sylius/sylius": "^1.12", - "sylius/mailer-bundle": "^1.8 || ^2.0", "symfony/webpack-encore-bundle": "^1.15" }, "require-dev": { "behat/behat": "^3.6.1", - "behat/mink-selenium2-driver": "^1.4", + "behat/mink-selenium2-driver": "^1.6", + "dbrekelmans/bdi": "^1.1", "dmore/behat-chrome-extension": "^1.3", "dmore/chrome-mink-driver": "^2.7", "friends-of-behat/mink": "^1.8", @@ -32,9 +32,11 @@ "phpstan/phpstan-doctrine": "1.3.16", "phpstan/phpstan-strict-rules": "^1.3.0", "phpstan/phpstan-webmozart-assert": "^1.2.0", - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6 || ^10.5", "polishsymfonycommunity/symfony-mocker-container": "^1.0", + "robertfausk/behat-panther-extension": "^1.1", "sylius-labs/coding-standard": "^4.2", + "sylius-labs/suite-tags-extension": "^0.2", "symfony/browser-kit": "^5.4 || ^6.0", "symfony/debug-bundle": "^5.4 || ^6.0", "symfony/dotenv": "^5.4 || ^6.0", diff --git a/tests/Application/config/bundles.php b/tests/Application/config/bundles.php index c02b9a3..b372d78 100644 --- a/tests/Application/config/bundles.php +++ b/tests/Application/config/bundles.php @@ -1,6 +1,6 @@ ['all' => true], Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], @@ -59,3 +59,8 @@ Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true], League\FlysystemBundle\FlysystemBundle::class => ['all' => true], ]; +if (class_exists(Sylius\Abstraction\StateMachine\SyliusStateMachineAbstractionBundle::class)) { + $bundles[Sylius\Abstraction\StateMachine\SyliusStateMachineAbstractionBundle::class] = ['all' => true]; +} + +return $bundles;