Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

feat(migrations): Advertise --reuse-db command for migration test #1335

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/docs/database-migrations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading