-
Notifications
You must be signed in to change notification settings - Fork 40
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
Want a way to test data migrations #4747
Labels
database
Related to database access
development
Bugs, paper cuts, feature requests, or other thoughts on making omicron development better
Testing & Analysis
Tests & Analyzers
Comments
david-crespo
added
database
Related to database access
Testing & Analysis
Tests & Analyzers
development
Bugs, paper cuts, feature requests, or other thoughts on making omicron development better
labels
Jan 2, 2024
omicron/nexus/tests/integration_tests/schema.rs Lines 479 to 506 in cfcf209
omicron/nexus/tests/integration_tests/schema.rs Lines 808 to 850 in cfcf209
(That said, the idea of "update to right before my schema change, populate some test data, do the change, then validate the state" seems super reasonable) |
smklein
added a commit
that referenced
this issue
Jan 9, 2024
Adds a schema test with "before" / "after" hooks, and adds an example specifically for the "23.0.0" migration. My intent is that this can be used for any other schema migrations that would like to execute arbitrary SQL checks against the new schema too. Fixes #4747
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
database
Related to database access
development
Bugs, paper cuts, feature requests, or other thoughts on making omicron development better
Testing & Analysis
Tests & Analyzers
While working on #4261, I found it hard to get confidence in my data migrations using existing tooling. One thing I found helpful was using DB Fiddle to write some similar tables and running similar migrations on them to make sure I got the expected results.
https://www.db-fiddle.com/f/pzmM69My6mZWq1NEKm56PG/1
However, this is lacking in ways that formal tooling could improve on:
So what I have in mind is essentially a way of:
The text was updated successfully, but these errors were encountered: