Skip to content

Ensure offline DefaultAzureCredential tests pass during live runs#8777

Merged
chlowell merged 2 commits intomasterfrom
conflicting-live-values
Nov 21, 2019
Merged

Ensure offline DefaultAzureCredential tests pass during live runs#8777
chlowell merged 2 commits intomasterfrom
conflicting-live-values

Conversation

@chlowell
Copy link
Member

This changes offline DefaultAzureCredential tests to use environment variables to set arbitrary values where appropriate.

For example, to test the behavior of shared_cache_username, we populate a cache with mock accounts whose tenants are arbitrary (but identical). When running the full live test suite, $AZURE_TENANT_ID will have a value which DefaultAzureCredential will pass to SharedCacheCredential, as it should. If this value doesn't match the arbitrary tenant of the mock accounts, the test will fail despite the correctness of the code under test because no cached account will match both the explicitly specified username and the implicitly specified tenant.

@chlowell chlowell added Client This issue points to a problem in the data-plane of the library. Azure.Identity labels Nov 21, 2019
@chlowell chlowell requested a review from bryevdv November 21, 2019 15:01
@chlowell chlowell requested a review from schaabs as a code owner November 21, 2019 15:01
@chlowell chlowell self-assigned this Nov 21, 2019
@adxsdk6
Copy link

adxsdk6 commented Nov 21, 2019

Can one of the admins verify this patch?

@chlowell chlowell merged commit c022aa6 into master Nov 21, 2019
@chlowell chlowell deleted the conflicting-live-values branch November 21, 2019 21:41
openapi-sdkautomation-test bot pushed a commit to openapi-env-test/azure-sdk-for-python that referenced this pull request Mar 24, 2020
Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs into keyvault_multiapi_readme

* 'master' of https://github.com/Azure/azure-rest-api-specs: (101 commits)
  add cli.md for automation (Azure#8411)
  adjust assignment (Azure#8782)
  Remove Microsoft.Backup.Admin 2016-05-01 API version (Azure#8588)
  Updating global setting in PostgreSQL/MySQL readme file (Azure#8777)
  update package name and output folder in readme.typescript.md (Azure#8764)
  add package-2019-12 python define (Azure#8769)
  Fix Parameter Description for validate resource move (Azure#8524)
  Edit pass for GA swagger (Azure#8759)
  Update proxy.json (Azure#8596)
  Model enums that may change in the future as strings (Azure#8760)
  Add api-version 2019-11-01 for resources/subscriptions (Azure#8728)
  regenerated all-api-versions
  PrivateLinkResources for Microsoft.Automation (Azure#8369)
  add cli.md for serialconsole (Azure#8401)
  add cli.md for mariadb (Azure#8466)
  [Computer Vision] Create CV API v3.0-preview (Azure#7402)
  Publish Microsoft.ContainerService api-version 2020-03-01 (Azure#8756)
  Update swagger based on auto-gen process change. (Azure#8766)
  add assignment-bot config (Azure#8716)
  add tag package-2019-12 to batch (Azure#8751)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Azure.Identity Client This issue points to a problem in the data-plane of the library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants