Repository navigation
Closed
coder/coder
#20901Description
CI Run: https://github.com/coder/coder/actions/runs/19623117684
Commit: a6581c71579dd1e87aec9f953e7e936ea7b19fe0 (Rowan Smith)
Workflow/job: nightly-gauntlet / test-go-pg (windows-2022)
When: 2025-11-24 ~04:26 UTC (same day as this alert)
Failure summary:
github.com/coder/coder/v2/provisioner/terraform_test [github.com/coder/coder/v2/provisioner/terraform.test]
provisioner\terraform\resources_test.go:124:9: undefined: updateGoldenFiles
Root cause assessment:
- Category: Code change / test scaffolding (not infrastructure, not data race, not process crash)
- resources_test.go (TestConvertStateGolden) references *updateGoldenFiles.
- updateGoldenFiles is only defined in provisioner/terraform/cleanup_test.go which has a platform build tag:
//go:build linux || darwin. - On Windows, cleanup_test.go is excluded, so the symbol is undefined when compiling resources_test.go.
Evidence:
- resources_test.go (around line 124):
if *updateGoldenFiles {
gotBytes, err := json.MarshalIndent(...)
...
} - cleanup_test.go top of file contains:
//go:build linux || darwin - cleanup_test.go defines:
var updateGoldenFiles = flag.Bool("update", false, "Update golden files")
Precise assignment analysis:
- Failing test function: TestConvertStateGolden in provisioner/terraform/resources_test.go
- Recent change adding this test: a61b8bc5cee008622f5035f706eb58f0bb4e0b9a ("test: add golden file test for ConvertState (#20832)") by Steven Masley (@Emyrk)
- The failure is due to missing test flag definition on Windows, introduced with the new test referencing updateGoldenFiles. Assigning to @Emyrk as the last modifier of the failing test function.
Proposed fix direction:
- Provide a Windows-visible definition of updateGoldenFiles (e.g., move the flag to a common *_test.go file without build tags, or add a windows-specific *_test.go that declares the flag), or guard the reference in resources_test.go behind a platform check.
Reproduction:
- Repro on Windows:
go test ./provisioner/terraformorGOOS=windows GOARCH=amd64 go test ./provisioner/terraform - CI context: Run link above; failing job: test-go-pg (windows-2022)
Duplicate search performed (no matches found):
- repo:coder/internal "undefined: updateGoldenFiles"
- repo:coder/internal "TestConvertStateGolden"
- repo:coder/internal resources_test.go updateGoldenFiles
Classification: Code Change / test failure on Windows due to platform-limited flag definition.
Metadata
Metadata
Assignees
Labels
No labels
Activity
[-]flake: TestConvertStateGolden fails on Windows (undefined: updateGoldenFiles)[/-][+]tests: TestConvertStateGolden fails on Windows (undefined: updateGoldenFiles)[/+]test: move TestConvertStateGolden to only linux + mac (coder#20901)
test: move TestConvertStateGolden to only linux + mac (#20901)