-
Notifications
You must be signed in to change notification settings - Fork 16.4k
test(providers/microsoft): add test case for AzureIdentityCredentialAdapter.signed_session #33687
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
Conversation
e2c626d to
ed4e093
Compare
|
Is it possible to test this? |
I've run it with #33433 and succeeded. As for unit testing, I'm not that sure. Even if I add some, they might be mocking without checking anything. Is there any suggestions? |
|
Not really, my impression is this wouldn’t be easy to test anyway, hence the question 😛 |
Yes. We often do a mock-only tests and It's also important. Mock is really a representation of "How the author imagined the code would interact with the external world". Since you tested it, and you have good understanding how it works. Coding that in the form of mock is capturing that knowledge. Imagine somene else making a change to that code 2 months from now. Or even YOURSELF doing it 2 months from now (I always try to picture future-self coming back to the code after I completely forgot what it does). If there is no mock and someone changes the behaviour accidentally, they won't notice and it might stop working accidentally. But when it fails, you will look at your test, and you will be able to quickly recall the intent you had without heavy debugging. I really treat those tests with mocks often as description of what I thought the class in question shoudl be doing - so that I even don't have to remember it. |
Got it. Thanks @potiuk for such a detailed response. I'll try to add some mock tests tomorrow |
…dapter.signed_session signed_session is the main function of this wrapper class
b11a15f to
ecb4586
Compare
potiuk
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.
LGTM
As discussed in this stackoverflow thread, part of the lib does not support azure-identity well and need this helper class.This PR is dependency of #33433, #33469, #33467Add test case to signed_session which is the main function of this wrapper class
^ 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 newsfragments.