Prevent SDK from invoking az during cmd/root tests#4710
Merged
Conversation
The SDK upgrade to v0.117.0 changed credential resolution such that Azure CLI auth is attempted even for non-Azure hosts. This causes `az account show` to be invoked during tests that go through auth resolution, adding ~0.5-2.5s per test and writing `.azure/` cache files into the source tree. Clear PATH in auth tests to prevent the SDK from finding `az`. For the bundle loader test, restrict PATH to system directories instead since the bundle loader currently requires a shell to be available (fixing that separately). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pietern
added a commit
that referenced
this pull request
Mar 11, 2026
Move the empty command check to the top of `Apply` so that `NewCommandExecutor` (which requires a shell) is not called when no script hook is configured. This avoids a hard dependency on a shell being available during bundle initialization. Closes #4710 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 tasks
Collaborator
|
Commit: 2cee048
16 interesting tests: 7 SKIP, 6 RECOVERED, 3 flaky
Top 21 slowest tests (at least 2 minutes):
|
github-merge-queue bot
pushed a commit
that referenced
this pull request
Mar 12, 2026
## Summary - Move the empty command check to the top of `script.Apply` so that `NewCommandExecutor` (which requires a shell to be available) is not called when no script hook is configured. - Simplify `executeHook` by passing the resolved command directly instead of re-fetching it from the bundle. Found out about this dependency during investigation of #4710. ## Test plan - [x] Existing unit tests pass - [x] No new behavior introduced; this is a refactor that reorders existing checks 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
simonfaltum
approved these changes
Mar 12, 2026
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
PATHincmd/rootauth tests to prevent the Go SDK (v0.117.0+) from shelling out toaz account showduring credential resolutionTestBundleConfigureDefault, restrictPATHto system directories instead of clearing it fully — the bundle loader's script hook mutator currently requires a shell to be present even when no scripts are configured (fixing that separately)PATH="/nothing"in prompt tests toPATH=""The SDK upgrade to v0.117.0 (databricks/databricks-sdk-go#1505, bumped in #4631) removed per-strategy cloud guards from Azure CLI credentials, causing
azto be probed on all platforms regardless of the configured host. This added ~0.5–2.5s per affected test and wrote.azure/cache files into the source tree.Verified on macOS and Windows.
Test plan
go test -count=1 ./cmd/rootpasses on macOS (1.2s, down from 5.2s)go test -count=1 ./cmd/rootpasses on Windows (0.19s).azure/orLibrary/directories created incmd/root/🤖 Generated with Claude Code