Browse Source

[TOOLS][TESTS] Ensure database schema is up to date in tests

experimental
Hugo Sales 3 months ago
parent
commit
eb3c848fc8
Signed by: someonewithpc <hugo@hsal.es> GPG Key ID: 7D0C7EAFC9D835A0
2 changed files with 6 additions and 3 deletions
  1. +1
    -1
      .env.test
  2. +5
    -2
      docker/tooling/coverage.sh

+ 1
- 1
.env.test View File

@@ -3,4 +3,4 @@ KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
PANTHER_APP_ENV=panther
DATABASE_URL=postgresql://postgres:password@db:5432/social
DATABASE_URL=postgresql://postgres:password@db:5432/test

+ 5
- 2
docker/tooling/coverage.sh View File

@@ -3,8 +3,11 @@
cd /var/www/social || exit 1

printf "Cleaning Redis cache: " && echo "FLUSHALL" | nc redis 6379
yes yes | php bin/console doctrine:fixtures:load || exit 1
php bin/console app:populate_initial_values # since loading fixtures purges the DB
bin/console doctrine:database:drop --force || exit 1
bin/console doctrine:database:create || exit 1
bin/console doctrine:schema:update --force || exit 1
yes yes | bin/console doctrine:fixtures:load || exit 1
bin/console app:populate_initial_values || exit 1

if [ "$#" -eq 0 ] || [ -z "$*" ]; then
vendor/bin/simple-phpunit -vvv --coverage-html .test_coverage_report


Loading…
Cancel
Save