Skip to content

Use TEST_ENVIRONMENT_TYPE for integration test filtering#1545

Draft
hectorcast-db wants to merge 8 commits intomainfrom
hectorcast-db/stack/port/test-environment-type
Draft

Use TEST_ENVIRONMENT_TYPE for integration test filtering#1545
hectorcast-db wants to merge 8 commits intomainfrom
hectorcast-db/stack/port/test-environment-type

Conversation

@hectorcast-db
Copy link
Contributor

@hectorcast-db hectorcast-db commented Mar 16, 2026

🥞 Stacked PR

Use this link to review incremental changes.


Summary

Test plan

  • Integration test preludes updated; backward compatible with existing CI

NO_CHANGELOG=true

This pull request was AI-assisted by Isaac.

Port of Python SDK PR #1318 and discovery URL fix from PR #1332.
Extract applyHostMetadata() from resolveHostMetadata() for reuse.
Call host metadata resolution during EnsureResolved() for unified hosts,
with non-fatal error handling (warns on failure instead of failing).
The OIDC endpoint from metadata is now treated as the OIDC root, with
/.well-known/oauth-authorization-server appended to form the full
discovery URL.

Co-authored-by: Isaac
Instead of silently ignoring the error from fixHostIfNeeded(), log it
as a warning before skipping host metadata resolution.

Co-authored-by: Isaac
@hectorcast-db hectorcast-db force-pushed the hectorcast-db/stack/port/test-environment-type branch from 6fd35bf to be1ea79 Compare March 16, 2026 12:07
Port of Python SDK PR #1321. When host metadata indicates an account host
(no workspace_id) and account_id is present, automatically set TokenAudience
to the account_id if not already configured by the user.

Co-authored-by: Isaac
Port of Python SDK PR #1330. Add serviceToServiceVisitorWithFallback()
which logs a warning and skips the secondary header when the SA token
source fails, instead of returning an error. GoogleDefaultCredentials
now always attempts to create an SA token source regardless of config
type, falling back gracefully on failure. GoogleCredentials also uses
the fallback visitor.

Co-authored-by: Isaac
@hectorcast-db hectorcast-db force-pushed the hectorcast-db/stack/port/test-environment-type branch from be1ea79 to 85df421 Compare March 16, 2026 13:08
Port of Python SDK PR #1317. Add support for the TEST_ENVIRONMENT_TYPE
environment variable to control which integration tests run. Supported
values: WORKSPACE, UC_WORKSPACE, ACCOUNT, UC_ACCOUNT. Falls back to
the existing DATABRICKS_ACCOUNT_ID-based logic when not set.

Co-authored-by: Isaac
@hectorcast-db hectorcast-db force-pushed the hectorcast-db/stack/port/test-environment-type branch from 85df421 to 0da1b0d Compare March 16, 2026 13:33
@github-actions
Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/sdk-go

Inputs:

  • PR number: 1545
  • Commit SHA: 0da1b0d546ab8842dffbd50aa55fb136bbeffddf

Checks will be approved automatically on success.

github-merge-queue bot pushed a commit that referenced this pull request Mar 16, 2026
## 🥞 Stacked PR
Use this
[link](https://github.com/databricks/databricks-sdk-go/pull/1542/files)
to review incremental changes.
-
[**stack/port/resolve-host-metadata-on-init**](#1542)
[[Files
changed](https://github.com/databricks/databricks-sdk-go/pull/1542/files)]
-
[stack/port/resolve-token-audience-from-metadata](#1543)
[[Files
changed](https://github.com/databricks/databricks-sdk-go/pull/1543/files/20b6cd4abc1a3284d586c88f802c4b7df2678062..9893d9cbbfe8baab7f7aeacb8ce7faf49026c86a)]
-
[stack/port/gcp-sa-token-non-blocking](#1544)
[[Files
changed](https://github.com/databricks/databricks-sdk-go/pull/1544/files/9893d9cbbfe8baab7f7aeacb8ce7faf49026c86a..07e28b7aef05ada2f357f87faa749c6990be8173)]
-
[stack/port/test-environment-type](#1545)
[[Files
changed](https://github.com/databricks/databricks-sdk-go/pull/1545/files/07e28b7aef05ada2f357f87faa749c6990be8173..0da1b0d546ab8842dffbd50aa55fb136bbeffddf)]
-
[stack/port/host-metadata-integration-test](#1546)
[[Files
changed](https://github.com/databricks/databricks-sdk-go/pull/1546/files/0da1b0d546ab8842dffbd50aa55fb136bbeffddf..e9854aad19dc522ffe8def175bef3a3eabface2b)]
-
[stack/port/remove-unified-flag](#1547)
[[Files
changed](https://github.com/databricks/databricks-sdk-go/pull/1547/files/e9854aad19dc522ffe8def175bef3a3eabface2b..fae626deb92c4671a0c8aa0f1e3e6bad1f8c5cc6)]
-
[stack/port/gcp-sa-from-metadata](#1548)
[[Files
changed](https://github.com/databricks/databricks-sdk-go/pull/1548/files/fae626deb92c4671a0c8aa0f1e3e6bad1f8c5cc6..ecb1dbeed4ed1990a74895c6ced958c05f16ffef)]

---------
## Summary
- Port of Python SDK PR
databricks/databricks-sdk-py#1318 and discovery
URL fix from PR
databricks/databricks-sdk-py#1332
- Extract `applyHostMetadata()` from `resolveHostMetadata()` for reuse
during config init
- Call host metadata resolution during `EnsureResolved()` for unified
hosts (gated behind `Experimental_IsUnifiedHost`), with non-fatal error
handling (warns on failure)
- OIDC endpoint from metadata is now treated as the OIDC root, with
`/.well-known/oauth-authorization-server` appended to form the full
discovery URL

## Test plan
- `TestEnsureResolved_ResolvesHostMetadata_WhenUnifiedHost` — verifies
fields populated from metadata
- `TestEnsureResolved_HostMetadataFailure_NonFatal` — 500 response,
config still resolves
- `TestEnsureResolved_HostMetadata_NoOidcEndpoint_NonFatal` — missing
oidc_endpoint, no error
-
`TestEnsureResolved_HostMetadata_MissingAccountIdWithPlaceholder_Warns`
— template needs account_id but missing
- Existing `resolveHostMetadata` tests updated for new discovery URL
format

NO_CHANGELOG=true

This pull request was AI-assisted by Isaac.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant