Skip to content

Commit

Permalink
script to setup integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrkwiecinski committed Aug 28, 2020
1 parent b172d03 commit 3c021ff
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions compose/bin/setup-integration-tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
source env/db.env

REAL_SRC=$(cd -P "src" && pwd)
MYSQL_CONFIG=dev/tests/integration/etc/install-config-mysql.php
INTEGRATION_DB=magento_integration_tests
CREATE_DB="bin/clinotty mysqladmin -hdb -uroot -p${MYSQL_ROOT_PASSWORD} create ${INTEGRATION_DB}" && echo "Database ${INTEGRATION_DB} created."
bin/clinotty mysql -hdb -uroot -p${MYSQL_ROOT_PASSWORD} ${INTEGRATION_DB} -e exit &> /dev/null || $CREATE_DB

sed -e "s/'db-host' => 'localhost'/'db-host' => 'db'/" \
-e "s/'db-password' => '123123q'/'db-password' => '${MYSQL_ROOT_PASSWORD}'/" \
-e "s/'amqp-host' => 'localhost'/'amqp-host' => 'rabbitmq'/" \
src/dev/tests/integration/etc/install-config-mysql.php.dist > src/dev/tests/integration/etc/install-config-mysql.php

# Workaround until coping nested files works as expected
docker cp $REAL_SRC/$MYSQL_CONFIG $(docker-compose ps -q phpfpm|awk '{print $1}'):/var/www/html/$MYSQL_CONFIG
echo "Completed copying $MYSQL_CONFIG from host to container"
bin/fixowns $MYSQL_CONFIG
bin/fixperms $MYSQL_CONFIG

0 comments on commit 3c021ff

Please sign in to comment.