mirror of
https://github.com/karatektus/pl_mail.git
synced 2026-10-25 01:54:10 +00:00
Migrate test databases with app:db:migrate so the cache tables exist (#225)
doctrine:migrations:migrate leaves cache_items out; without it the first cache read inside a test's transaction aborts it, so ThreadSummaryTest and the Gmail import tests failed whenever nothing had created the table first.
This commit is contained in:
1 parent
57f92f1170
commit
e23377eb6a
2 files changed
+9
-3
No files matched your search
+8
-2
@@ -21,7 +21,13 @@
|
|||||||
# to invent a second DATABASE_URL.
|
# to invent a second DATABASE_URL.
|
||||||
#
|
#
|
||||||
# The cost is that a fresh database needs creating, migrating and seeding, which
|
# The cost is that a fresh database needs creating, migrating and seeding, which
|
||||||
# is what the rest of this does. Migrations are a no-op once they have run, so
|
# is what the rest of this does. Migrated with app:db:migrate, as an install is,
|
||||||
|
# not doctrine:migrations:migrate: the migrations leave the cache tables out
|
||||||
|
# (see DatabaseCacheTables) and only the app's command creates them. Without
|
||||||
|
# them the first cache read inside a test's transaction fails, Postgres aborts
|
||||||
|
# the transaction, and whichever test got there first errors with "current
|
||||||
|
# transaction is aborted" — ThreadSummaryTest or the Gmail import tests,
|
||||||
|
# depending on what ran before them. Migrations are a no-op once they have run, so
|
||||||
# only the first invocation is slow.
|
# only the first invocation is slow.
|
||||||
#
|
#
|
||||||
# The two seeded users are not optional: PageRendersTest, ListFragmentTest and
|
# The two seeded users are not optional: PageRendersTest, ListFragmentTest and
|
||||||
@@ -32,7 +38,7 @@ set -e
|
|||||||
export TEST_TOKEN=_unit
|
export TEST_TOKEN=_unit
|
||||||
|
|
||||||
php bin/console doctrine:database:create --if-not-exists --quiet
|
php bin/console doctrine:database:create --if-not-exists --quiet
|
||||||
php bin/console doctrine:migrations:migrate --no-interaction --allow-no-migration --quiet
|
php bin/console app:db:migrate --no-interaction --quiet
|
||||||
php bin/console app:test:seed-user --quiet
|
php bin/console app:test:seed-user --quiet
|
||||||
php bin/console app:test:seed-user --admin --email=e2e-admin@plmail.test --password=e2e-admin-password --quiet
|
php bin/console app:test:seed-user --admin --email=e2e-admin@plmail.test --password=e2e-admin-password --quiet
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -57,7 +57,7 @@ services:
|
|||||||
set -e
|
set -e
|
||||||
[ -f vendor/autoload_runtime.php ] || composer install --prefer-dist --no-progress --no-interaction
|
[ -f vendor/autoload_runtime.php ] || composer install --prefer-dist --no-progress --no-interaction
|
||||||
php bin/console doctrine:database:create --if-not-exists
|
php bin/console doctrine:database:create --if-not-exists
|
||||||
php bin/console doctrine:migrations:migrate --no-interaction --allow-no-migration
|
php bin/console app:db:migrate --no-interaction
|
||||||
php bin/console importmap:install
|
php bin/console importmap:install
|
||||||
php bin/console tailwind:build \
|
php bin/console tailwind:build \
|
||||||
|| { sleep 5; php bin/console tailwind:build; } \
|
|| { sleep 5; php bin/console tailwind:build; } \
|
||||||
|
|||||||
Reference in new issue
Block a user