Skip to content

Conversation

@Lee-W
Copy link
Member

@Lee-W Lee-W commented Nov 4, 2023

This was messed up when working on fixing the typing issue on https://github.com/apache/airflow/pull/35394/files#diff-107c8c5868dad1579df1506bfae6a93f38cb51c9120ab11ce26a695e3c8a8464R91. Just fixed it and add a few test cases


^ 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.rst or {issue_number}.significant.rst, in newsfragments.

assert "workload_identity_tenant_id" in widgets


@mock.patch(f"{MODULE}.DefaultAzureCredential")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Lee-W, the changes look good. Do you think it is a good idea to elaborate the unit tests a bit by adding mock objects and running tests to compare expected vs. actual for the method calls?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. I think the main point here is verifying we're calling the right object

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah - for me it's enough to check they are called. Too detailed tests are often problematic - especially in case of some auth methods that tend to change when client libraries change. We often have to fix such tests when new versions of libraries are released just to add a new parameter expected etc. So I'd say just "called" is good enough for me - especially that we have detailed test for the credentials class itself

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, @Lee-W and @potiuk, thanks for clarifying.

@Lee-W Lee-W requested a review from potiuk November 5, 2023 04:07
@potiuk potiuk merged commit 2980eb1 into apache:main Nov 5, 2023
romsharon98 pushed a commit to romsharon98/airflow that referenced this pull request Nov 10, 2023
@ephraimbuddy ephraimbuddy added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Nov 20, 2023
@ephraimbuddy ephraimbuddy added this to the Airflow 2.8.0 milestone Nov 20, 2023
@Lee-W Lee-W deleted the fix-get_async_default_azure_credential branch June 5, 2024 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) provider:microsoft-azure Azure-related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants