Skip to content

shiftedreality/module-imagine-docker-demo-2020

Repository files navigation

Introduction

This module is a part of Imagine'20 Cloud Docker MFTF Lab session.

Terms

  • Docker: A software that performs operating-system-level virtualization
  • Mutagen: A real-time file synchronization and flexible network forwarding, extending the reach of your existing development tools to cloud-based containers and infrastructure

Related repositories

Environment setup

Follow instruction on DevDocs

MFTF dependency

If you don't have MFTF dependency added:

composer require "magento/magento2-functional-testing-framework" --no-update && composer update

Production mode

Toggle

Build docker-compose.yml

./vendor/bin/ece-docker build:compose --with-selenium

Start containers

./bin/magento-docker up

Deploy Magento

./bin/magento-docker ece-redeploy

Developer mode

Toggle

Add dependencies

composer config repositories.demo vcs https://github.com/shiftedreality/module-imagine-docker-demo-2020
composer config minimum-stability dev
composer require "magento/module-demo" --no-update

Build docker-compose.yml

./vendor/bin/ece-docker build:compose --mode developer --with-selenium --sync-engine mutagen

Start containers

./bin/magento-docker up

Start Mutagen

./mutagen.sh

This step takes some time. To verify the status, run:

mutagen monitor

Deploy Magento

./bin/magento-docker ece-redeploy

OR if Magento was previosuly compiled and patched:

./bin/magento-docker ece-deploy

Set Developer Mode

docker-compose run --rm deploy magento-command deploy:mode:set developer

Prepare Magento

docker-compose run --rm test magento-command config:set system/full_page_cache/caching_application 2 --lock-env
docker-compose run --rm test magento-command setup:config:set --http-cache-hosts=varnish -n
docker-compose run --rm test magento-command config:set admin/security/admin_account_sharing 1
docker-compose run --rm test magento-command config:set admin/security/use_form_key 0
docker-compose run --rm test magento-command config:set web/secure/use_in_adminhtml 0
docker-compose run --rm test magento-command cache:clean

Open Magento

Prepare MFTF tests

Prepare configs

CONFIG="MAGENTO_BASE_URL=http://magento2.docker/
MAGENTO_BACKEND_NAME=admin
MAGENTO_ADMIN_USERNAME=admin
MAGENTO_ADMIN_PASSWORD=123123q
MODULE_WHITELIST=Magento_Framework,Magento_ConfigurableProductWishlist,Magento_ConfigurableProductCatalogSearch
SELENIUM_HOST=selenium"

docker-compose run --rm test bash -c "echo \"$CONFIG\" > /app/dev/tests/acceptance/.env"

Build artifacts

docker-compose run --rm test mftf-command build:project
docker-compose run --rm test mftf-command generate:tests --debug=none

Run Tests

docker-compose run --rm test mftf-command run:test AdminLoginTest --debug=none

IF you added a Demo moudle in Developer mode:

docker-compose run --rm test mftf-command run:test OpenStorefrontDemoPageTest --debug=non

About

Imagine 2020 Cloud Docker lab module

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published