-
-
Notifications
You must be signed in to change notification settings - Fork 437
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script for running MTF locally via Docker.
- Loading branch information
1 parent
4444884
commit 7c35cee
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
TEST_SUITE=functional | ||
FUNCTIONAL_DIR=$(dirname $(dirname $BASH_SOURCE[0])) | ||
MAGENTO_HOST_NAME="mtf_php" | ||
COMPOSER_CACHE=$HOME/.composer/cache | ||
|
||
echo "Starting test environment" | ||
cd $FUNCTIONAL_DIR/docker | ||
docker-compose -p mtf up -d | ||
|
||
echo "Installing Composer dependencies" | ||
docker run --rm \ | ||
--volume $FUNCTIONAL_DIR:/app --volume ${COMPOSER_HOME:-$HOME/.composer}:/tmp \ | ||
--user $(id -u):$(id -g) \ | ||
composer --ignore-platform-reqs install --no-interaction | ||
|
||
echo "Installing Magento" | ||
docker exec mtf_mysql mysql -uroot -e 'CREATE DATABASE magento;' | ||
docker exec mtf_php php -f install.php -- \ | ||
--license_agreement_accepted yes \ | ||
--locale en_US --timezone "America/Los_Angeles" --default_currency USD \ | ||
--db_host 127.0.0.1 --db_name magento --db_user root --db_pass "" \ | ||
--url "http://${MAGENTO_HOST_NAME}/" --use_rewrites yes --use_secure no \ | ||
--secure_base_url "http://${MAGENTO_HOST_NAME}/" --use_secure_admin no \ | ||
--admin_lastname Owner --admin_firstname Store --admin_email "[email protected]" \ | ||
--admin_username admin --admin_password asd123#2*53515523 \ | ||
--encryption_key "I2V7t7fiCIRKw9FWz4m3CStgeBG1T+ATZ0Us+W8jAIk=" | ||
|
||
echo "Launching PHPUnit runner" | ||
docker exec -it mtf_php dev/tests/functional/run_functional.sh | ||
|
||
echo "Stopping test environment" | ||
cd $FUNCTIONAL_DIR/docker | ||
docker-compose -p mtf down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
export TEST_SUITE=functional | ||
|
||
|
||
# Before Install | ||
#./dev/travis/before_install.sh | ||
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -screen 0 1280x1024x24 | ||
|
||
export DISPLAY=:1.0 | ||
sh ./vendor/se/selenium-server-standalone/bin/selenium-server-standalone -port 4444 -host 127.0.0.1 \ | ||
-Dwebdriver.firefox.bin=$(which firefox) -trustAllSSLCertificate &> ~/selenium.log & | ||
|
||
cp ./phpunit.xml.dist ./phpunit.xml | ||
#sed -e "s?127.0.0.1?${MAGENTO_HOST_NAME}?g" --in-place ./phpunit.xml | ||
#sed -e "s?basic?travis_acceptance?g" --in-place ./phpunit.xml | ||
|
||
php -f utils/generate.php | ||
|
||
dev/tests/functional/vendor/phpunit/phpunit/phpunit -c dev/tests/$TEST_SUITE |