Repository navigation
test(cli): clear service-specific AWS endpoint overrides in every test stub - #2227
Merged
Merged
Conversation
…t stub Shared clearAWSEndpointOverrides helper blanks AWS_ENDPOINT_URL_* and AWS_IGNORE_CONFIGURED_ENDPOINT_URLS; used by isolateAWSEnv, rdsAPIStub.serveEnv and the GCP signal child launcher. Closes #2222 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Warning Review limit reached
This review includes 4 billable files and costs up to $1.00.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 20 minutes for your next included review. View limit details
Comment |
Member
Author
Independent review verdict: CLEAN at 0edd8e1Reviewer: fresh Claude agent (Sonnet, high effort), not the author. Coordinator: claude-cc-reviewer. What was checked:
Gate:
|
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.
Closes #2222
Summary
Some test stubs pointed the AWS SDK at a local server by setting only
AWS_ENDPOINT_URLor a single service-specific URL. A developer's own environment could defeat that in two ways:AWS_ENDPOINT_URL_RDStakes precedence.AWS_IGNORE_CONFIGURED_ENDPOINT_URLS=truemakes the SDK ignore the env endpoints entirely.When that happens, the tests go off-host.
This PR moves the endpoint-clearing loop that #2225 added in
isolateAWSEnvinto one helper,clearAWSEndpointOverrides(t), incmd/multi_service_test.go. The helper blanks everyAWS_ENDPOINT_URL_*variable found inos.Environ()and clearsAWS_IGNORE_CONFIGURED_ENDPOINT_URLS. It is now used by:isolateAWSEnvrdsAPIStub.serveEnv, which still setsAWS_ENDPOINT_URLand_COST_EXPLORERafter the clearstartGCPInterruptChild, before it launches the child. The child inheritsos.Environ()and then sets its own secretsmanager URL.purchase_confirmation_test.go, before its explicitAWS_ENDPOINT_URL/_RDS/_EC2linesThe change is test-only.
Evidence
All runs are local, on macOS, with
GOTOOLCHAIN=go1.26.9. They use fixtures and a CONNECT-logging proxy.AWS_ENDPOINT_URL_RDS=https://rds.example.invalid,AWS_IGNORE_CONFIGURED_ENDPOINT_URLS=true, fake creds) fails-run 'ExclusionDataUnavailable|ExtendedSupportDataUnavailable|GCP'. The proxy logged 2 CONNECTs to secretsmanager and about 38 tords.example.invalid._STS,_COST_EXPLORERand_ORGANIZATIONS.serveEnvmakesExtendedSupportDataUnavailablefail under the hostile env.startGCPInterruptChilddoes not fail a test. Only the CONNECT count shows it. test(cli): fail the cmd package on any off-host request #2221's package-level off-host guard would turn this into a test failure.make build,go vet ./...andgo test -race ./cmd/...pass. golangci-lint v2.10.1 reports 0 issues.scripts/test-git-secrets-allowlist.shpasses 44/44.purchase_confirmation_test.go, now applied. The final confirmation found no actionable findings at 0edd8e1.🤖 Generated with Claude Code