You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Changes
Decouples provider tests from the Databricks Go SDK's
`Config.HostType()` back-door, where
`isTesting && AccountID != ""` causes `HostType()` to return
`AccountHost` regardless of the
configured `Host`. Tests previously relied on this shortcut by setting
only `AccountID` and
leaving `Host` empty.
This PR makes every account-level test declare its Host explicitly, so
the SDK can eventually
drop the `isTesting` special-case without provider-test fallout.
1. **`qa/testing.go`** — `ResourceFixture` gains a `Host` field that
threads into
`config.Config.Host`. `MockAccountsApply` now reads `Host` from the mock
account client's own
config (`ma.AccountClient.Config.Host`) instead of hardcoding
`https://accounts.cloud.databricks.com` — the test now owns the value.
2. **`exporter/importables_test.go`** —
`importContextForAccountTestWithClient` no longer
calls `client.Config.WithTesting()`. Exporter account tests no longer
ride the SDK's
`isTesting` shortcut.
3. **~20 `ResourceFixture` tests** (`catalog/`, `mws/`, `scim/`,
`apps/`, `finops/`,
`permissions/`, `tokens/`) — set `Host` explicitly where needed, or add
`api = "account"` to
HCL so the resource's own routing logic runs. Dead `Fixtures:
[]qa.HTTPFixture{}` entries
removed from tests that made no HTTP calls.
4. **`exporter/impl_{billing,serverless,uc}_test.go`** — 29 callbacks
now call
`setupAwsAccountConfig(ma)` (or `setupAzureAccountConfig(ma)` for
Azure-specific tests) at the
top, matching the existing convention in `impl_mws_test.go` /
`impl_oauth_test.go`. Replaces
partial `Config = &config.Config{AccountID: ...}` inline blocks that
silently relied on
`WithTesting()` to fill in the Host.
### Storage credential conversion
`TestStorageCredentialImportAccountLevel` converted from `HTTPFixture`
to
`MockAccountClientFunc` since the test exercises mock-client paths.
## Tests
- `make fmt` ✅
- `make lint` ✅
- `make test` — 3084 tests pass, 0 failures
- Tested by removing the isTesting check:
#5593
NO_CHANGELOG=true
0 commit comments