Skip to content

Commit fc8adfe

Browse files
Create test database and run migrations on initial run
1 parent f5f6b26 commit fc8adfe

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

buildspecs/run-tests.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ phases:
1616
- echo Tests started on `date`
1717
- ls -lha
1818
- IMAGE_URI=$(jq -r '.ImageURI' $CODEBUILD_SRC_DIR_DevelopmentImageArtifact/imageDetail.json)
19-
- docker-compose -f docker-compose.test.yml run php vendor/bin/simple-phpunit
19+
- |
20+
docker-compose -f docker-compose.test.yml exec php bin/console doctrine:migrations:migrate --no-interaction --env=test --quiet && \
21+
docker-compose -f docker-compose.test.yml exec php vendor/bin/simple-phpunit
2022
- run -i $TEST_IMAGE_URI php bin/simplephpunit
2123
post_build:
2224
commands:

docker-compose.test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ services:
2222
image: mysql:5.7
2323
environment:
2424
- MYSQL_ROOT_PASSWORD=root
25+
- MYSQL_DATABASE=beep_test
26+
command: ['--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']

0 commit comments

Comments
 (0)