-
-
Notifications
You must be signed in to change notification settings - Fork 924
In migration test, do inserts before some migrations to avoid empty tables #5539
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
Comments
I can take this one |
Are you considering any specific (common for diesel) approach to implement these test migrations, or this ticket assumes figuring it out? |
The mentioned test is here. Implementing this would work more or less so:
|
Do you think it's worth to invest into a more extensible solution? Like, a module with test migrations that run after corresponding migration is finished? |
Not sure what you mean, but its better to keep things simple and avoid unnecessary complexity. |
Okay, I see that for now it's enough to add test data once. I've been thinking about situation when it's not enough, and you need to run, for instance, 10 migrations then add some test data, then next 15 migrations and add more data, then 20 and more data etc. But it's not the case |
I'm also not sure this would work, because it'd need custom tests after specific migrations have been run. |
Its enough to check after all migrations are finished that the test data still exists. |
This would catch errors that only happen if some tables have at least one row, such as #5531
The text was updated successfully, but these errors were encountered: