Skip to content

Commit

Permalink
bug #647 [Maintenance] Fix build & prepare it for Sylius v1.11 (lchru…
Browse files Browse the repository at this point in the history
…sciel)

This PR was merged into the 1.10-dev branch.

Discussion
----------

Content of PR:
- Changes to PHP, Node and Sf versions
- Usage of sync messenger transport in testing required for proper testing results
- Temporary removal of schema validation waiting for the Sylius release after: Sylius/Sylius#13214
- Whitespace removal in Behat tags - could be omitted, as it is minor stuff, but deprecation error was driving me nuts
- Due to some strange issue with test test execution(ref. https://github.com/Sylius/Sylius-Standard/actions/runs/1688323707) the [vendor/sylius/sylius/features/promotion/managing_catalog_promotions/toggling_catalog_promotion.feature:35](https://github.com/Sylius/Sylius/blob/54dcc4f2ed0a4fea5908fbea3bd69a0f27f16fa1/features/promotion/managing_catalog_promotions/toggling_catalog_promotion.feature#L35-L40) scenario broke in the UI(was fine in API), while was green when I trigger it locally. While run in separation, it was green also on CI, so I've decided to split it to separate run in CI what solved the issue 
- I had to add webprofiler to test cached env due to changes introduced here: Sylius/Sylius#12990. It is needed to register TracableMessegeBus for testing purposes

The build is finally green, but TBH I'm mindblown with the strangeness of errors. If anyone would like to solve them better, be my guests.
  
For the two last issues I've alse left comments in commits for future understanding of problems

Commits
-------

c20eed1 [Maintenance] Run GitHub actions on PHP 8, Node 14 & Symfony 5.4
dc2d180 [Config] Use doctrine transport as default for Symfony Messenger
92d9b2d [Config] Use sync transport for test env
32c5c8c [Maintenance] Temporary removal of schema validation due to changes in payum to support dbal v3
69b3b45 [Maintenance] Remove whitespace in tag defintion
468e37a [Behat] Run managing catalog promotion scenarios in separation
b910859 [Behat] Import web profiler test config into test cached
  • Loading branch information
GSadee authored Jan 14, 2022
2 parents 191b52b + b910859 commit ece9cde
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ MAILER_URL=smtp://localhost
###> symfony/messenger ###
# Choose one of the transports below
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
# MESSENGER_TRANSPORT_DSN=doctrine://default
MESSENGER_TRANSPORT_DSN=doctrine://default
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
###< symfony/messenger ###

Expand Down
5 changes: 5 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private-test.pem
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public-test.pem
JWT_PASSPHRASE=ALL_THAT_IS_GOLD_DOES_NOT_GLITTER_NOT_ALL_THOSE_WHO_WANDER_ARE_LOST
###< lexik/jwt-authentication-bundle ###

###> symfony/messenger ###
# Sync transport turned for testing env for the ease of testing
MESSENGER_TRANSPORT_DSN=sync://
###< symfony/messenger ###
5 changes: 5 additions & 0 deletions .env.test_cached
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private-test.pem
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public-test.pem
JWT_PASSPHRASE=ALL_THAT_IS_GOLD_DOES_NOT_GLITTER_NOT_ALL_THOSE_WHO_WANDER_ARE_LOST
###< lexik/jwt-authentication-bundle ###

###> symfony/messenger ###
# Sync transport turned for testing env for the ease of testing
MESSENGER_TRANSPORT_DSN=sync://
###< symfony/messenger ###
24 changes: 10 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,11 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ["7.4", "8.0"]
symfony: ["^4.4", "^5.2"]
node: ["10.x"]
php: ["8.0"]
symfony: ["^4.4", "^5.4"]
node: ["14.x"]
mysql: ["5.7", "8.0"]

exclude:
-
php: "7.4"
mysql: "5.7"
env:
APP_ENV: test_cached
DATABASE_URL: "mysql://root:[email protected]/sylius?serverVersion=${{ matrix.mysql }}"
Expand Down Expand Up @@ -160,10 +156,6 @@ jobs:
name: Run PHPStan
run: vendor/bin/phpstan analyse -c phpstan.neon -l max src/

-
name: Validate database schema
run: bin/console doctrine:schema:validate

-
name: Run PHPSpec
run: vendor/bin/phpspec run --ansi -f progress --no-interaction
Expand All @@ -172,13 +164,17 @@ jobs:
name: Run PHPUnit
run: vendor/bin/phpunit --colors=always

-
name: Run managing catalog promotion scenarios
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@todo&&~@cli&&@managing_catalog_promotions"

-
name: Run non-JS Behat
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@javascript && ~@todo && ~@cli"
name: Run non-JS Behat (without managing catalog promotion scenarios)
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@todo&&~@cli&&@~managing_catalog_promotions"

-
name: Run JS Behat
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@javascript && ~@todo && ~@cli" || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@javascript && ~@todo && ~@cli" --rerun || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@javascript && ~@todo && ~@cli" --rerun
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@javascript&&~@todo&&~@cli" || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@javascript&&~@todo&&~@cli" --rerun || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@javascript&&~@todo&&~@cli" --rerun

-
name: Upload Behat logs
Expand Down
2 changes: 1 addition & 1 deletion behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ default:

gherkin:
filters:
tags: "~@todo && ~@cli" # CLI is excluded as it registers an error handler that mutes fatal errors
tags: "~@todo&&~@cli" # CLI is excluded as it registers an error handler that mutes fatal errors
2 changes: 2 additions & 0 deletions config/packages/test_cached/web_profiler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
imports:
- { resource: "../test/web_profiler.yaml" }

0 comments on commit ece9cde

Please sign in to comment.