Add parametrized unit tests for auth types across host profiles#1627
Merged
hectorcast-db merged 3 commits intomainfrom Apr 15, 2026
Merged
Add parametrized unit tests for auth types across host profiles#1627hectorcast-db merged 3 commits intomainfrom
hectorcast-db merged 3 commits intomainfrom
Conversation
Tests that each auth type resolves correctly on every applicable host profile (LW, NW, LA, NA, SPOGW, SPOGA) across AWS, Azure, and GCP clouds. Covers pat, basic, oauth-m2m, databricks-cli, github-oidc, env-oidc, file-oidc, metadata-service, azure-client-secret, azure-cli, github-oidc-azure, and azure-devops-oidc (165 subtests total). Co-authored-by: Isaac Signed-off-by: Hector Castejon Diaz <hector.castejon@databricks.com>
tejaskochar-db
approved these changes
Apr 15, 2026
Contributor
tejaskochar-db
left a comment
There was a problem hiding this comment.
Tests look fine to me, some nits
- Use existing noopLoader{} from api_client.go instead of defining
a duplicate noopProfileLoader
- Remove unused accountProfiles; compute workspaceProfiles locally
in the one test that needs it (MetadataService)
- Refactor TestProfileAuth_AzureCli to use profileConfig(p) like
all other tests
Co-authored-by: Isaac
Signed-off-by: Hector Castejon Diaz <hector.castejon@databricks.com>
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
config/auth_profiles_test.gowith 165 parametrized subtests covering 12 auth types across 6 host profiles (LW, NW, LA, NA, SPOGW, SPOGA) on AWS, Azure, and GCPHostMetadataResolverto inject host metadata, exercising the full production resolution path includingDiscoveryURLpopulationLoaders: []Loader{noopLoader}to isolate tests from environment variable contaminationProfiles tested
account_id+workspace_idaccount_id+workspace_idaccount_idAuth types covered
pat, basic, oauth-m2m, databricks-cli, github-oidc, env-oidc, file-oidc, metadata-service, azure-client-secret, azure-cli, github-oidc-azure, azure-devops-oidc
Not covered (with rationale)
google-credentials,google-id:GoogleCredentials.ConfigureandGoogleDefaultCredentials.Configurecall Google SDK functions (idtoken.NewTokenSource,impersonate.IDTokenSource) that parse real crypto keys and make HTTP calls internally. No seam exists to inject mocks viaHTTPTransportwithout refactoring production code.NO_CHANGELOG=true
Test plan
go test ./config/ -run TestProfileAuth)go test ./config/passes)This pull request was AI-assisted by Isaac.