Skip to content

Commit

Permalink
Merge pull request #487 from spryker-shop/bugfix/cc-33312-dynamic-store
Browse files Browse the repository at this point in the history
CC-33312: Added E2E Cypress UI tests into CI process for Dynamic multistore.
  • Loading branch information
dmiseev authored May 10, 2024
2 parents 2e54291 + b818b7f commit 40521ed
Show file tree
Hide file tree
Showing 4 changed files with 322 additions and 6 deletions.
53 changes: 49 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,12 @@ jobs:
- name: Run PHPStan
run: vendor/bin/phpstan analyze -l 6 -c phpstan.neon src/

- name: Run Evaluator for main branch
- name: Run Evaluator for release branches
run: vendor/bin/evaluator evaluate --format=compact
if: github.ref == 'refs/heads/master'
if: github.event.pull_request.base.ref == 'master' && startsWith(github.event.pull_request.head.ref, 'release-')

- name: Run Evaluator for feature branches
- name: Run Evaluator for all branches
run: vendor/bin/evaluator evaluate --exclude-checkers=SPRYKER_DEV_PACKAGES_CHECKER --format=compact
if: github.ref != 'refs/heads/master'

php-82-mariadb-glue-alpine:
name: "PHP 8.2 / MariaDB / Glue / Alpine"
Expand Down Expand Up @@ -669,6 +668,52 @@ jobs:
docker/sdk cli console queue:worker:start --stop-when-empty
- name: Run Tests
run: |
docker/sdk exec cypress-tests cp .env.example .env
for i in 1 2; do
docker/sdk exec --env "ENV_REPOSITORY_ID=b2c" cypress-tests npm run cy:ci && s=0 && break || s=$? && echo "Test failed, retrying..."
sleep 1
done
(exit $s)
- name: Upload artifacts
if: failure()
run: |
AWS_DEFAULT_REGION=${{env.ROBOT_TESTS_ARTIFACTS_BUCKET_REGION}} AWS_ACCESS_KEY_ID=${{ secrets.ROBOT_TESTS_ARTIFACTS_KEY }} AWS_SECRET_ACCESS_KEY=${{ secrets.ROBOT_TESTS_ARTIFACTS_SECRET }} aws s3 cp .cypress s3://${{vars.ROBOT_TESTS_ARTIFACTS_BUCKET}}/cypress-ui/b2c/${GITHUB_RUN_ID}/ \
--recursive \
--expires "$(date -d '+7 days' --utc +'%Y-%m-%dT%H:%M:%SZ')"
docker-alpine-php-8-2-mariadb-cypress-dynamic-multistore:
name: "Docker / Alpine / PHP 8.2 / MariaDB / Cypress / UI / Dynamic Store"
runs-on: ubuntu-22.04
env:
PROGRESS_TYPE: plain
SPRYKER_PLATFORM_IMAGE: spryker/php:8.2
TRAVIS: 1
ROBOT_TESTS_ARTIFACTS_BUCKET_REGION: eu-west-1
steps:
- uses: actions/checkout@v3

- name: Install packages
run: |
sudo apt-get install apache2-utils
sudo apt install awscli -q
- name: Composer install
run: composer install
- name: Install docker-compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/2.12.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
- name: Install Project
continue-on-error: true
run: |
git clone https://github.com/spryker/docker-sdk.git ./docker
docker/sdk boot -v deploy.ci.acceptance.mariadb.dynamic-store.cypress.yml
sudo bash -c "echo '127.0.0.1 backend-api.eu.spryker.local backend-api.us.spryker.local backend-gateway.eu.spryker.local backend-gateway.us.spryker.local backoffice.eu.spryker.local backoffice.us.spryker.local glue-backend.eu.spryker.local glue-backend.us.spryker.local glue-storefront.eu.spryker.local glue-storefront.us.spryker.local glue.eu.spryker.local glue.us.spryker.local mail.spryker.local mp.eu.spryker.local mp.us.spryker.local queue.spryker.local scheduler.spryker.local spryker.local swagger.spryker.local yves.eu.spryker.local yves.us.spryker.local' >> /etc/hosts"
docker/sdk up -t -v
docker/sdk cli composer dump-autoload -o -a --apcu
docker/sdk cli console queue:worker:start --stop-when-empty
- name: Run Tests
run: |
docker/sdk exec cypress-tests cp .env.dynamic-store.example .env
for i in 1 2; do
docker/sdk exec --env "ENV_REPOSITORY_ID=b2c" cypress-tests npm run cy:ci && s=0 && break || s=$? && echo "Test failed, retrying..."
sleep 1
Expand Down
4 changes: 2 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

131 changes: 131 additions & 0 deletions config/install/docker.ci.acceptance.dynamic-store.cypress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
env:
NEW_RELIC_ENABLED: 0
SPRYKER_LOG_STDOUT: /dev/null

sections:
build:
generate-transfers:
command: 'vendor/bin/console transfer:generate'

router-cache-warmup-yves:
command: 'vendor/bin/yves router:cache:warm-up'

router-cache-warmup-backoffice:
command: 'vendor/bin/console router:cache:warm-up:backoffice'

router-cache-warmup-backend-gateway:
command: 'vendor/bin/console router:cache:warm-up:backend-gateway'

twig-cache-warmup:
command: 'vendor/bin/console twig:cache:warmer'

navigation-cache-warmup:
command: 'vendor/bin/console navigation:build-cache'

rest-request-validation-cache-warmup:
command: 'vendor/bin/console rest-api:build-request-validation-cache'

propel-copy-schema:
command: 'vendor/bin/console propel:schema:copy'

propel-build:
command: 'vendor/bin/console propel:model:build'

generate-entity-transfer:
command: 'vendor/bin/console transfer:entity:generate'

generate-page-source-map:
command: 'vendor/bin/console search:setup:source-map'

translator-generate-cache:
command: 'vendor/bin/console translator:generate-cache'

cache-class-resolver-build:
command: 'vendor/bin/console cache:class-resolver:build'

generate-scope-collection-file:
command: 'vendor/bin/console oauth:scope-collection-file:generate'

build-development:
generate-transfers:
command: 'vendor/bin/console transfer:generate'

generate-transfer-databuilders:
command: 'vendor/bin/console transfer:databuilder:generate'

rest-api-generate-documentation:
command: 'vendor/bin/console rest-api:generate:documentation'

build-static:
dependencies-install:
command: 'vendor/bin/console frontend:project:install-dependencies'

build-static-production:
excluded: true
yves-build-frontend:
command: 'vendor/bin/console frontend:yves:build -e production'

zed-build-frontend:
command: 'vendor/bin/console frontend:zed:build -e production'

date-time-product-configurator:
command: 'vendor/bin/console frontend:date-time-product-configurator:build'

build-static-development:
yves-build-frontend:
command: 'vendor/bin/console frontend:yves:build'

zed-build-frontend:
command: 'vendor/bin/console frontend:zed:build'


date-time-product-configurator:
command: 'vendor/bin/console frontend:date-time-product-configurator:build'

init-storages-per-region:
propel-copy-schema:
command: 'vendor/bin/console propel:schema:copy'

propel-postgres-compatibility:
command: 'vendor/bin/console propel:pg-sql-compat'

propel-migration-delete:
command: 'vendor/bin/console propel:migration:delete'

propel-diff:
command: 'vendor/bin/console propel:diff'

propel-migrate:
command: 'vendor/bin/console propel:migrate'

propel-migration-cleanup:
command: 'vendor/bin/console propel:migration:delete'

demodata:
queue-setup:
command: 'vendor/bin/console queue:setup'

init-database:
command: 'vendor/bin/console setup:init-db'

import-eu-region-demodata:
command: 'vendor/bin/console data:import --config=data/import/local/full_EU.yml'

apply-scheduled-prices:
command: 'vendor/bin/console price-product-schedule:apply'

setup-search-create-sources:
command: 'vendor/bin/console search:setup:sources'

update-product-labels:
command: 'vendor/bin/console product-label:relations:update'

publish-and-sync:
command: 'vendor/bin/console queue:worker:start --stop-when-empty'
timeout: 2000

controller-cache-warmup:
command: 'vendor/bin/glue glue-api:controller:cache:warm-up'

api-generate-documentation:
command: 'vendor/bin/glue api:generate:documentation'
140 changes: 140 additions & 0 deletions deploy.ci.acceptance.mariadb.dynamic-store.cypress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
version: '0.1'

namespace: spryker_ci
tag: '1.0'

environment: docker.ci.cypress
pipeline: docker.ci.acceptance.dynamic-store.cypress
image:
tag: spryker/php:8.2
environment:
SPRYKER_PRODUCT_CONFIGURATOR_HOST: date-time-configurator-example.spryker.local
SPRYKER_PRODUCT_CONFIGURATOR_PORT: 80
SPRYKER_CONFIGURATOR_ENCRYPTION_KEY: 'change123'
SPRYKER_YVES_HOST_EU: yves.eu.spryker.local
SPRYKER_DYNAMIC_STORE_MODE: true
SPRYKER_PUSH_NOTIFICATION_WEB_PUSH_PHP_VAPID_PUBLIC_KEY: 'BGqNWbv0hWM5CQ1-KwAfSQBMC6TMVFyrnh3vQp37oGCNvQ6eG_HyMjxBFJRWeCPTbzDoxcjhxLJS8Ck8r1G2oFw'
SPRYKER_PUSH_NOTIFICATION_WEB_PUSH_PHP_VAPID_PRIVATE_KEY: 'UK6DywwjKITPpRHBSY9TLPIXm6BPrHX40sseIoXT9c8'
SPRYKER_PUSH_NOTIFICATION_WEB_PUSH_PHP_VAPID_SUBJECT: 'https://spryker.com'
node:
version: 18
npm: 9

composer:
mode: ''
autoload: --classmap-authoritative

regions:
EU:
services:
mail:
sender:
name: Spryker No-Reply
email: no-reply@spryker.local
database:
database: eu-docker
username: spryker
password: secret

broker:
namespace: eu-docker
key_value_store:
namespace: 1
search:
namespace: eu_search
groups:
EU:
region: EU
applications:
yves_eu:
application: yves
endpoints:
date-time-configurator-example.spryker.local:
entry-point: Configurator
yves.eu.spryker.local:
region: EU
services:
session:
namespace: 1
glue_eu:
application: glue
endpoints:
glue.eu.spryker.local:
region: EU
backoffice_eu:
application: backoffice
endpoints:
backoffice.eu.spryker.local:
region: EU
services:
session:
namespace: 3
backend_gateway_eu:
application: backend-gateway
endpoints:
backend-gateway.eu.spryker.local:
region: EU
primal: true
backend_api_eu:
application: zed
endpoints:
backend-api.eu.spryker.local:
region: EU
entry-point: BackendApi
glue_storefront_eu:
application: glue-storefront
endpoints:
glue-storefront.eu.spryker.local:
region: EU
glue_backend_eu:
application: glue-backend
endpoints:
glue-backend.eu.spryker.local:
region: EU

services:
database:
engine: mysql
version: mariadb-10.4
root:
username: 'root'
password: 'secret'
endpoints:
localhost:3306:
protocol: tcp
broker:
engine: rabbitmq
version: '3.9'
api:
username: 'spryker'
password: 'secret'
session:
engine: redis
key_value_store:
engine: redis
search:
engine: elastic
version: '7.10'
mail_catcher:
engine: mailhog

docker:
ssl:
enabled: false

debug:
enabled: false
xdebug:
enabled: false

testing:
region: EU

mount:
native:
platforms:
- linux

compose:
yamls:
- vendor/spryker/cypress-tests/docker-compose.cypress.yml

0 comments on commit 40521ed

Please sign in to comment.