-
Notifications
You must be signed in to change notification settings - Fork 16.4k
[AIRFLOW-5793] add test to detect multiple alembic revision heads #6449
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
[AIRFLOW-5793] add test to detect multiple alembic revision heads #6449
Conversation
|
@Fokko was unsure about exactly right naming for test file and location. e.g. could have called it |
Fokko
left a comment
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.
Love it, one comment
tests/test_alembic.py
Outdated
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.
Maybe move this test to https://github.com/apache/airflow/blob/master/tests/utils/test_db.py
This file contains a closely related test, to check if the schema of the database, and the schema in the python files are in sync.
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.
Maybe also add a small comment on when we could have two heads, and how to resolve it :-)
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 think this would be better to have in the PR template? (and also in the 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.
I think the PR template is already pretty bloated :) (I think we should somehow simplify this). I found it initially useful, but then it becomes more and more tiresome. Let's not make it more complex.
I think everything that is now in the template should be automatically verified by the checks in CI and commiters should not even think about checking it.
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.
Agree with Fokko -> better have less test files.
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 think the PR template is already pretty bloated :) (I think we should somehow simplify this). I found it initially useful, but then it becomes more and more tiresome. Let's not make it more complex.
Totally agree. Would be nice if we the template changes depending on the files that changed.
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.
Can you rebase onto master and move this test to the other file? :-)
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.
Yes will do very shortly was out for a bit
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.
moved test. added small comment, just pointing user to alembic merge command.
b6a6b44 to
737ae44
Compare
Codecov Report
@@ Coverage Diff @@
## master #6449 +/- ##
==========================================
- Coverage 83.99% 83.68% -0.31%
==========================================
Files 627 627
Lines 36537 36537
==========================================
- Hits 30690 30577 -113
- Misses 5847 5960 +113
Continue to review full report at Codecov.
|
|
Thanks @dstandish |
1 similar comment
|
Thanks @dstandish |
Make sure you have checked all steps below.
Jira
Description
Depending on the timing of merges with migrations, we can end up with two revision heads that need to be merged.
This adds a test to detect when multiple heads are present.
Tests
Commits
Documentation