-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Use env var connections instead of mocks in kube system tests #54261
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 env var connections instead of mocks in kube system tests #54261
Conversation
|
@potiuk I think you will like this one :) |
jason810496
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.
Nice cleanup!
|
nice indeed :) |
|
Ah, had to include the pytest plugin. |
gopidesupavan
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.
cool :) thanks for updating
|
@potiuk getting a clarification here, these tests are separate distros out of providers but use provider code, so do we cherry pick these to v3-0-x branches? |
|
the However - some of the "kubernetes_test" are only using that K8S setup to run "KPO" on running k8s instance (and the fact that that instance was installed to run airflow - does not matter" To be on the safe-side - I'd cherry-pick, also because it makes it easier to cherry-pick changes that should for sure be tested on v3-0-test. |
Yeah i had similar thoughts too regarding this. Let me manually do it |
…ests (#54261) * Use env var connections instead of mocks in kube system tests * adding right pytest plugings * adding right pytest plugings * adding right pytest plugings (cherry picked from commit d410915) Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
|
Heres the cherry pick #54320 |
…#54261) * Use env var connections instead of mocks in kube system tests * adding right pytest plugings * adding right pytest plugings * adding right pytest plugings
Why?
While working on #54083, I happened to notice that the kube system tests started failing with:
The reason for this is that those tests used a mock on
get_connectionwhich is mid-way to the entire flow of getting a connection (models connection had an internalget_connectiondefined on connection backends and this test was bypassing it). The currentmock_get_connectionfixture usesmock.patchto return a minimalConnectionobject with onlyconn_idset.A better OR more complete pattern would be to actual create the connection using env vars on the host machine as part of the test setup that runs, that would ensure that no unneccessary mocking is performed and Connection retrieval flow works normally (backend > env > api server)
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.