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

Commit

Permalink
feat(migrations): Advertise --reuse-db command for migration test (#1335
Browse files Browse the repository at this point in the history
)
  • Loading branch information
davidenwang authored Jul 18, 2024
1 parent 525d2ae commit fcebf3d
Showing 1 changed file with 2 additions and 0 deletions.
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

0 comments on commit fcebf3d

Please sign in to comment.