Fix T-1325: Compile integration tests in default build & fix loadAWSConfig stubs#214
Conversation
…nfig stubs Two loadAWSConfig stubs in cmd/deploy_integration_test.go used the old signature (missing context.Context), so `go test -tags integration ./cmd/` failed to build. The files were gated by //go:build integration, but the Makefile and CI run `INTEGRATION=1 go test ./...` without that tag, so they were never compiled or run and the drift stayed invisible. - Fix both loadAWSConfig stub signatures to take context.Context - Remove //go:build integration from both integration test files; they already gate at runtime via testutil.SkipIfIntegration, so they now compile in the default build (CI catches drift) and run under INTEGRATION=1 - Skip the rotted TestDeploymentWorkflow_EndToEnd (real CFN client + inline-tags drift) pending T-1340 - Update CLAUDE.md integration-test docs (env-var gating, not a build tag)
There was a problem hiding this comment.
Pull request overview
This pull request fixes a build break in cmd integration tests caused by loadAWSConfig’s signature change, and ensures these integration test files are compiled by default so similar drift is caught by CI/standard test runs.
Changes:
- Update
loadAWSConfigstubs incmd/deploy_integration_test.goto acceptcontext.Context. - Remove
//go:build integrationgating fromcmdintegration test files so they compile in defaultgo test ./...runs while still runtime-skip unlessINTEGRATION=1. - Temporarily skip the rotted
TestDeploymentWorkflow_EndToEndtest (tracked as T-1340) and document integration test gating inCLAUDE.md.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| specs/bugfixes/deploy-integration-test-build/report.md | Adds a bugfix report documenting root cause, resolution, and verification for T-1325. |
| cmd/drift_integration_test.go | Removes the integration build tag so the file compiles in default test builds. |
| cmd/deploy_integration_test.go | Fixes loadAWSConfig stub signatures, removes build tag, and skips the known-rotted end-to-end test. |
| CLAUDE.md | Updates integration test documentation to reflect env-var/runtime gating and default compilation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code Review — T-1325: Fix integration test build & loadAWSConfig stubsOverviewThis PR correctly identifies and fixes two layered defects:
The fix — remove the build tags, rely on the existing What's Good
Issues1. Redundant double-skip in
|
Put the t.Skip(T-1340) before SkipIfIntegration so the repair reason is shown regardless of whether INTEGRATION=1 is set.
Code Review: Fix T-1325 — Compile integration tests in default build & fix
|
| Finding | Severity | Action |
|---|---|---|
t.Skip before SkipIfIntegration makes guard unreachable |
Medium | Swap order before T-1340 is resolved |
deploy_output_integration_test.go lacks SkipIfIntegration |
Low | Follow-up to align naming or add gate |
tc := tc loop capture unnecessary in Go 1.25 |
Low | Follow-up cleanup |
| CI doesn't run integration test bodies | Observation | Tracked in specs report; follow up with T-1340 |
The core fix (stub signatures + build tag removal) is correct and should be merged.
Reviewed by Claude Sonnet 4.6
Summary
go test -tags integration ./cmd/failed to build: twoloadAWSConfigstubs incmd/deploy_integration_test.goused the stale signaturefunc(c config.Config)instead of the currentfunc(ctx context.Context, config config.Config)(loadAWSConfig = config.DefaultAwsConfig, which gained acontext.Context).This went unnoticed because the integration files were gated by
//go:build integration, while the Makefile (test-integration,test-all) and CI runINTEGRATION=1 go test ./...without-tags integration— so the files were never compiled or run by any documented path. The build tag was also redundant with thetestutil.SkipIfIntegration(t)runtime gate the files already use.Changes
loadAWSConfigstub signatures (addcontext.Context).//go:build integrationfromcmd/deploy_integration_test.goandcmd/drift_integration_test.go. They still skip at runtime viaSkipIfIntegration, but now compile in the defaultgo test ./...build (so CI catches this class of drift) and run underINTEGRATION=1. Aligns with the project Go rules (env-var gating over build tags).TestDeploymentWorkflow_EndToEnd(it makes a realCreateChangeSetcall → "Missing Region", and treats inline tags as a file) pending T-1340.CLAUDE.mdintegration-test docs.Verification
go test ./...compiles + passes (integration bodies skip at runtime).INTEGRATION=1 go test ./...passes — 10/11 integration tests run (7 drift + 3 deploy workflow);TestDeploymentWorkflow_EndToEndskipped pending T-1340.golangci-lint run ./...reports 0 issues.Bugfix report:
specs/bugfixes/deploy-integration-test-build/report.md