Repository navigation
test(cli): make engine-version error-handling tests hermetic - #2207
Conversation
TestQueryMajorEngineVersions_ErrorHandling and TestQueryRunningInstanceEngineVersions_ErrorHandling loaded the real AWS config and issued live API calls (34s and 9s per run), and only asserted inside `if err != nil`, so they passed whether or not credentials existed. Remove the major-versions test: profile precedence is covered by TestQueryMajorEngineVersions_ProfileSelection and engine failures by the stubbed TestQueryMajorEngineVersionsWithClient_* tests. Replace the running-instance test with TestQueryRunningInstanceEngineVersions_ProfileSelection, which uses isolateAWSEnv and nonexistent profiles so config loading fails before any AWS call, and unconditionally asserts the error names the selected profile. Region and engine failure paths already have stubbed tests (TestQueryRDSInstancesInRegions_*), so no production seam is added. Closes #1328 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reached
This review includes 1 billable file and costs up to $0.25.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 28 minutes for your next included review. View limit details
Comment |
Merge-gate verdict: CLEAN at c7f0e34Independent adversarial review (non-author agent, Sonnet high, cold brief, full diff Coverage was checked case by case against the deleted tests. All of the old assertions were guarded by
Non-blocking notes:
Local verification on macOS at c7f0e34:
CI is green on c7f0e34, mergeability is CLEAN, and labels are mirrored from #1328. CR waived: quota, adversarial review + local verification + green CI. A retrospective CR review is tracked as a follow-up. 🤖 Generated with Claude Code |
Resolve test-file conflict with LeanerCloud#2207: keep this PR's TestIsInExtendedSupport_ZeroStartDateWarns and main's TestQueryRunningInstanceEngineVersions_ProfileSelection; drop TestQueryMajorEngineVersions_ErrorHandling as main deleted it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes #1328
Summary
TestQueryMajorEngineVersions_ErrorHandlingandTestQueryRunningInstanceEngineVersions_ErrorHandlingloaded the real AWS config and made live API calls. Each run took 34s and 9s. Both asserted only insideif err != nil, so they passed whether or not credentials existed.TestQueryMajorEngineVersions_ErrorHandling. The existingTestQueryMajorEngineVersions_ProfileSelection(cmd/multi_service_coverage_test.go:108) already covers its profile cases. Its engine-error case is covered by the stubbedTestQueryMajorEngineVersionsWithClient_EngineErrorContinues(:83) and_EngineFailuresAreAggregated(cmd/multi_service_extended_support_unavailable_test.go:259). The only case without a replacement is "empty profile", which asserted nothing beyond not panicking.TestQueryRunningInstanceEngineVersions_ProfileSelection. It usesisolateAWSEnvand nonexistent profiles, so config loading fails before any AWS call. It asserts unconditionally that the call errors, that the error names the selected profile, and that both result maps are nil.Deviation from the issue: the issue suggests extracting a
queryRunningInstanceEngineVersionsWithClientseam. I didn't add it. The region and engine failure paths already go throughqueryRDSInstancesInRegions(cmd/multi_service_engine_versions.go:61), whichTestQueryRDSInstancesInRegions_*already stubs: all regions failing, mid-pagination failure, worker panic, empty inventory, and a cancelled context.Evidence (local, macOS,
GOTOOLCHAIN=go1.26.9)loadValidationAWSConfigignore the validation profile fails the "validation profile takes precedence" case.queryRunningInstanceEngineVersionsreturn a nil error fails both cases.make build: ok.go vet ./...: clean.go test -race ./cmd/...: 1433 passed.go test -shuffle=on -count=2 ./cmd/fails the flag-validation tests through shared global flag state. The same seed fails on a clean origin/main copy. I'm filing it as its own issue.🤖 Generated with Claude Code