Восстановлена работа php тестов

This commit is contained in:
ErickSkrauch 2016-10-03 02:01:21 +03:00
parent c162a46e62
commit 0468076548
3 changed files with 28 additions and 18 deletions

View File

@ -2,7 +2,7 @@
cd /var/www/html cd /var/www/html
if [ "$1" = 'bash' ] if [ "$1" = "bash" ] || [ "$1" = "composer" ]
then then
exec "$@" exec "$@"
exit 0 exit 0
@ -28,6 +28,11 @@ then
cp -r ./../dist ./frontend/dist cp -r ./../dist ./frontend/dist
fi fi
wait-for-it db:3306 -- "./yii migrate/up --interactive=0" if [ "$YII_ENV" != "test" ]
then
wait-for-it db:3306 -- "php /var/www/html/yii migrate/up --interactive=0"
else
wait-for-it testdb:3306 -- "php /var/www/html/tests/codeception/bin/yii migrate/up --interactive=0"
fi
exec "$@" exec "$@"

View File

@ -1,17 +1,26 @@
version: '2' version: '2'
services: services:
testphp: testphp:
extends: container_name: accountelyby_testphp
file: ../docker-compose.dev.yml build:
service: app context: ../
dockerfile: Dockerfile-dev
depends_on:
- testdb
- testredis
- testrabbit
volumes: volumes:
- ./../:/var/www/html/ - ./../:/var/www/html/
env_file: ./../.env environment:
- YII_DEBUG=true
- YII_ENV=test
# Это я потом, когда-нибудь, уберу
- XDEBUG_CONFIG=remote_host=10.254.254.254
- PHP_IDE_CONFIG=serverName=docker
testdb: testdb:
extends: container_name: accountelyby_testdb
file: ../docker-compose.dev.yml build: ./../docker/mariadb
service: db
environment: environment:
MYSQL_ROOT_PASSWORD: "" MYSQL_ROOT_PASSWORD: ""
MYSQL_ALLOW_EMPTY_PASSWORD: "yes" MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
@ -20,14 +29,12 @@ services:
MYSQL_PASSWORD: "ely_accounts_tester_password" MYSQL_PASSWORD: "ely_accounts_tester_password"
testredis: testredis:
extends: container_name: accountelyby_testredis
file: ../docker-compose.dev.yml image: redis:3.0-alpine
service: redis
testrabbit: testrabbit:
extends: container_name: accountelyby_testrabbit
file: ../docker-compose.dev.yml image: rabbitmq:3.6
service: rabbitmq
environment: environment:
RABBITMQ_DEFAULT_USER: "ely-accounts-tester" RABBITMQ_DEFAULT_USER: "ely-accounts-tester"
RABBITMQ_DEFAULT_PASS: "tester-password" RABBITMQ_DEFAULT_PASS: "tester-password"

View File

@ -3,6 +3,4 @@
cd "$(dirname "$0")" cd "$(dirname "$0")"
./../vendor/bin/codecept build ./../vendor/bin/codecept build
./../vendor/bin/codecept run $*
./../docker/wait-for-it.sh testdb:3306 testrabbit:5672 -- \
php codeception/bin/yii migrate/up --interactive=0 && ./../vendor/bin/codecept run $*