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

feat(migrations): add docs for snapshots & backup testing #1324

Merged
merged 4 commits into from
Jul 1, 2024

Conversation

shellmayr
Copy link
Member

There are currently no docs describing how to resolve failing backup tests in CI when adding a new model. This PR adds these docs to the develop page on migrations.

Copy link

vercel bot commented Jun 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
develop ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 1, 2024 8:24am

### 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#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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the other links to Sentry's GH files in the docs point to the file within specific commit, maybe here that would also be good idea, because the line number can easily change in the future

@shellmayr shellmayr merged commit c68434c into master Jul 1, 2024
5 checks passed
@shellmayr shellmayr deleted the shellmayr/feat/add-docs-for-snapshot-backup-tests branch July 1, 2024 08:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants