From fcebf3d5432233fe33781306f5defffa5cca4080 Mon Sep 17 00:00:00 2001 From: David Wang Date: Thu, 18 Jul 2024 11:56:42 -0700 Subject: [PATCH] feat(migrations): Advertise --reuse-db command for migration test (#1335) --- src/docs/database-migrations.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/docs/database-migrations.mdx b/src/docs/database-migrations.mdx index 64062c1add..c6b091d773 100644 --- a/src/docs/database-migrations.mdx +++ b/src/docs/database-migrations.mdx @@ -88,6 +88,8 @@ class MyMigrationTest(TestMigrations): To run the test locally, run `pytest` with `--migrations` flag. For example, `pytest -v --migrations tests/getsentry/migrations/test_0XXX_migration_name.py`. +If you would like to speed up the migration tests and do not require rebuilding the databases on each test run, supply `--reuse-db` as an additional option to the test command. + ### Backup Testing When you add or change a model, an error message in CI may appear explaining that one or multiple tests "produced an `export.json` backup file that was missing the above models". In order to resolve this, there are two steps: