=== FAIL: provisioner/terraform TestGetModulesArchive/PackingMultipleSkipped (0.00s)
modules_internal_test.go:232:
Error: "[]" should have 3 item(s), but has 0
Messages: all three large modules should be skipped
=== FAIL: provisioner/terraform TestGetModulesArchive/PackingEdgeCaseExactFit (0.00s)
modules_internal_test.go:208:
Error: Received unexpected error:
failed to write modules.json to archive:
github.com/coder/coder/v2/provisioner/terraform.GetModulesArchiveWithLimit
provisioner/terraform/modules.go:194
- i/o limit reached:
github.com/coder/coder/v2/coderd/util/xio.init
coderd/util/xio/limitwriter.go:9
=== FAIL: provisioner/terraform TestGetModulesArchive/PackingAllFit (0.00s)
modules_internal_test.go:159:
Error: Received unexpected error:
open .terraform/modules/mod1/payload: The system cannot find the file specified.
CI Run Link: https://github.com/coder/coder/actions/runs/21617155575
Job: test-go-pg (windows-2022)
Commit: b8b8387b277d333718ecbd6fbe068547a9e94dc9 (Dean Sheather) coder/coder@b8b8387
Failure:
Root cause assessment:
moduleArchiveFSusesfilepath.Join, which stores moduleDirentries with backslashes (e.g.,.terraform\modules\mod1) inmodules.json.GetModulesArchiveWithLimitchecksstrings.HasPrefix(it.Dir, ".terraform/modules/"), so Windows module dirs fail the prefix check and are skipped entirely. This leaves the archive empty (skipped list length 0, module payloads missing), and in the exact-fit test results inactualSizebeing 0, which triggers thei/o limit reachederror when writingmodules.json.filepath.ToSlash(it.Dir)before prefix checks (and/or compare usingfilepath.Clean+ OS-aware prefix), so Windows dirs are recognized.Assignment analysis:
Related issues:
Reproduction:
go test ./provisioner/terraform -run TestGetModulesArchive