Skip to content

tests: use .test TLD for bare-hostname fixtures#5220

Merged
janniklasrose merged 1 commit intomainfrom
janniklasrose/ci-timings
May 8, 2026
Merged

tests: use .test TLD for bare-hostname fixtures#5220
janniklasrose merged 1 commit intomainfrom
janniklasrose/ci-timings

Conversation

@janniklasrose
Copy link
Copy Markdown
Contributor

Changes

Rename bare-hostname test fixtures (no TLD) to use .test:

  • libs/databrickscfg/profile/testdata/databrickscfghttps://default, https://query/?o=1234, https://foo
  • libs/databrickscfg/profile/testdata/sample-home/.databrickscfghttps://default
  • libs/databrickscfg/loader_test.goHost: fields and the multiple profiles matched error-message assertion
  • libs/databrickscfg/ops_test.go — only the two cases that match the renamed shared fixture profiles
  • cmd/labs/project/testdata/installed-in-home/.databrickscfghttps://abc

https://accounts.cloud.databricks.com and https://spog[-dup].databricks.com in the same files are intentionally left as-is.

Why

Follow-up to #5189. That sweep replaced real .com hosts; this catches the bare-hostname variants the .com filter missed. The SDK well-known endpoint resolver treats single-label hosts as real DNS lookups, so these fixtures stall ~3s each on the Windows CI runner.

From test-output.json of run 25496981743 (win-tf):

Test linux windows
TestLoaderSkipsExistingAuth 0.01s 3.04s
TestLoaderSkipsExplicitAuthType 0.01s 2.79s
TestLoaderMatchingHostWithQuery 0.03s 2.78s
TestLoaderMatchingHost 0.00s 2.76s
TestLoaderSkipsNonExistingConfigFile 0.01s 2.75s
TestLoaderSkipsNoMatchingHost 0.01s 1.27s
cmd/labs/project: TestRunningCommand 0.10s 2.98s
cmd/labs/project: TestRenderingTable 0.03s 2.92s
cmd/labs/project: TestRunningBlueprintEchoProfileWrong 0.01s 2.76s

~25s per Windows job × 2 engines = ~50s expected to come back. Scope is limited to fixtures that actually trigger the resolver. Other https://foo-style strings in ops_test.go are in tempdir-only tests that never hit DNS and remain untouched to keep the diff focused.

Tests

  • go test ./libs/databrickscfg/... ./cmd/labs/project/... passes locally.
  • ./task fmt, ./task checks, ./task lint all clean.
  • Watch the Windows-tf job duration on this PR — expect ~25–50s improvement.

This PR was written by Claude Code.

Follow-up to #5189. The previous sweep replaced real `.com` hosts with
`.test`; this catches the bare-hostname variants (`https://foo`,
`https://default`, `https://abc`, `https://noneofthehostsmatch`,
`https://query/?o=...`) that survived because they didn't match the
`.com` filter.

The SDK well-known endpoint resolver still treats single-label hosts as
real DNS lookups, so these fixtures stall ~3s each on the Windows CI
runner. From `test-output.json` of run 25496981743:

| Test                                           | linux  | windows |
|------------------------------------------------|--------|---------|
| TestLoaderSkipsExistingAuth                    | 0.01s  | 3.04s   |
| TestLoaderSkipsExplicitAuthType                | 0.01s  | 2.79s   |
| TestLoaderMatchingHostWithQuery                | 0.03s  | 2.78s   |
| TestLoaderMatchingHost                         | 0.00s  | 2.76s   |
| TestLoaderSkipsNonExistingConfigFile           | 0.01s  | 2.75s   |
| TestLoaderSkipsNoMatchingHost                  | 0.01s  | 1.27s   |
| cmd/labs/project: TestRunningCommand           | 0.10s  | 2.98s   |
| cmd/labs/project: TestRenderingTable           | 0.03s  | 2.92s   |
| cmd/labs/project: TestRunningBlueprintEcho...  | 0.01s  | 2.76s   |

Total ~25s per Windows job (×2 with direct + terraform engines).

Scope is limited to fixtures that actually trigger the resolver (loader
tests + labs project fixture). Other `https://foo`-style strings in
`ops_test.go` are in tempdir-only tests that never hit DNS and remain
untouched to keep the diff focused.

Co-authored-by: Isaac
Copy link
Copy Markdown
Contributor

@denik denik left a comment

Choose a reason for hiding this comment

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

Nice!

@janniklasrose janniklasrose merged commit e4a77e1 into main May 8, 2026
29 of 30 checks passed
@janniklasrose janniklasrose deleted the janniklasrose/ci-timings branch May 8, 2026 12:27
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.

2 participants