- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 65
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
Use migra instead of pum for the db migration tests #308
Conversation
8b9142c
to
bd477af
Compare
Codecov Report
@@ Coverage Diff @@
## master #308 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 30 30
Lines 1609 1609
Branches 183 183
=========================================
Hits 1609 1609 Continue to review full report at Codecov.
|
a8726da
to
5d7f98c
Compare
There are pros and cons to switching from pum to migra for our database migration tests. pros When migra detects differences between the two databases it provides the SQL DDL code to use to go from the source database to the target database, which can help developers write migrations for their changes. Here's an example of output when the
Compare it to when pum is used:
The output of pum is not nice, and it's not of the most useful either. cons The part that I like the least with migra is that it pulls the dependencies sqlbag, schemainspect and sqlalchemy. I actually like sqlbag and sqlalchemy, but we don't use them in Procrastinate and it feels a bit strange to use them in our tests. |
I'm ok having tests new dependencies as long as it's only test. |
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.
Preliminary 👍, waiting for the docs
Maybe we could include |
Yes, So migra (and its dependencies) are installed when using |
That's not what I meant, sorry :) . I meant as a non mandatory requirement for the dev / tests. The related tests would be skipped if the dependency is not present, and they would be ran in a dedicated env in CI. |
I should have figured out that you knew "migra" was a dev extra require 😉 Going back to your idea, yes, that's an option. But not sure it's worth the effort and extra complexity. And developers would not understand if the tests passed on their local dev environments, but not on the CI. |
I think our tox setup makes it not so complicated. Are sqlalchemy or sqlbag known to have side effects ? Would there be a reason the lib would fail without them if we don't explicitely write |
I removed the pum howto, and replaced it with a migrations howto. This is ready for review. |
4c2b05a
to
f7eb29a
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.
a few details in the doc. Otherwise, 👍
With this PR we switch from
pum
tomigra
for the db migration tests.migra
provides for a better API, making our db migration tests look better. Andmigra
provides the SQL DDL code to use to go from the source database to the target database, which can help developers write migrations for their changes.Successful PR Checklist: