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

Commit

Permalink
Add code line number to github URL & edited for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
shellmayr committed Jun 28, 2024
1 parent 845fa39 commit d63cbb7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/docs/database-migrations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ To run the test locally, run `pytest` with `--migrations` flag. For example, `py
### 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:
1. Add the new or modified model to the exhaustive organization in [testutils/helpers/backups.py](https://github.com/getsentry/sentry/blob/master/src/sentry/testutils/helpers/backups.py) by creating an instance of your model, for example MyModel.objects.create(). This ensures the presence of the new model when creating the snapshot and during testing.
1. Add the new or modified model to the exhaustive organization in [testutils/helpers/backups.py](https://github.com/getsentry/sentry/blob/master/src/sentry/testutils/helpers/backups.py#L366) by creating an instance of your model, for example by invoking MyModel.objects.create(). This ensures the presence of the new model when creating the snapshot and during testing.
2. The snapshot files can be regenerated using the following command:
```
SENTRY_SNAPSHOTS_WRITEBACK=1 pytest tests/sentry/backup/test_sanitize.py
Expand Down

0 comments on commit d63cbb7

Please sign in to comment.