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:
Paul Lützner authored and GitHub committed 2026-10-19 13:51:50 +02:00
1 parent 57f92f1170
commit e23377eb6a
2 files changed
+9 -3

No files matched your search

+8 -2
View File
@@ -21,7 +21,13 @@
# to invent a second DATABASE_URL.
#
# 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.
#
# The two seeded users are not optional: PageRendersTest, ListFragmentTest and
@@ -32,7 +38,7 @@ set -e
export TEST_TOKEN=_unit
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 --admin --email=e2e-admin@plmail.test --password=e2e-admin-password --quiet
+1 -1
View File
@@ -57,7 +57,7 @@ services:
set -e
[ -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:migrations:migrate --no-interaction --allow-no-migration
php bin/console app:db:migrate --no-interaction
php bin/console importmap:install
php bin/console tailwind:build \
|| { sleep 5; php bin/console tailwind:build; } \