-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add database fixtures for testing migrations #4858
Conversation
eb57cd3
to
511c213
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I enjoy the automated nature of this - it'll just tell us when we broke prior versions!
How do you imagine we'll promote devs to add a new dump or fixture?
This comment was marked as outdated.
This comment was marked as outdated.
@kylecarbs with 7d1c3e8 it looks like this:
|
This PR is now pretty much complete:
The only remaining issue would be to improve how fast a user might run into the migration/fixture error, but I think we can improve that when/if it becomes annoying. @bpmct would love your input on this (esp. the docs part). |
This reverts commit 15348d2.
This PR adds two types of fixtures for testing database migrations
coderd/database/migrations/testdata/fixtures
coderd/database/migrations/testdata/full_dumps/vX.X.X
For 1), the purpose of the
fixtures
folder is for us to incrementally add data we feel should be tested during a migration, it's based on a complete dump, but the idea is to evolve it via manual additions (see 000024 example).For 2), the purpose is for us to easily take a specific version of Coder, create a deployment, dump the database, and ensure that this deployment upgrades without issue for all eternity.
TODO
000022
in file names and how to add fixturesQuestions
Thoughts on where to place the documentation?
coderd/datdabase/migrations
?