diff --git a/bin/test-unit.sh b/bin/test-unit.sh index a2cfee9d..f4e4aa22 100644 --- a/bin/test-unit.sh +++ b/bin/test-unit.sh @@ -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 diff --git a/compose.test.yaml b/compose.test.yaml index 43913c5c..e7ccf13b 100644 --- a/compose.test.yaml +++ b/compose.test.yaml @@ -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; } \