{"record":{"id":"00195c666fc02672","repo":"hashicorp/terraform","slug":"unrecognized-test-progress-s","errorCode":null,"errorMessage":"unrecognized test progress: %s","messagePattern":"unrecognized test progress: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"internal/command/views/test.go","lineNumber":161,"sourceCode":"\t\t} else {\n\t\t\tt.view.streams.Println(\".\")\n\t\t}\n\t} else {\n\t\tt.view.streams.Println()\n\t}\n}\n\nfunc (t *TestHuman) File(file *moduletest.File, progress moduletest.Progress) {\n\tswitch progress {\n\tcase moduletest.Starting, moduletest.Running:\n\t\tt.view.streams.Printf(t.view.colorize.Color(\"%s... [light_gray]in progress[reset]\\n\"), file.Name)\n\tcase moduletest.TearDown:\n\t\tt.view.streams.Printf(t.view.colorize.Color(\"%s... [light_gray]tearing down[reset]\\n\"), file.Name)\n\tcase moduletest.Complete:\n\t\tt.view.streams.Printf(\"%s... %s\\n\", file.Name, colorizeTestStatus(file.Status, t.view.colorize))\n\t\tt.Diagnostics(nil, file, file.Diagnostics)\n\tdefault:\n\t\tpanic(\"unrecognized test progress: \" + progress.String())\n\t}\n}\n\nfunc (t *TestHuman) Run(run *moduletest.Run, file *moduletest.File, progress moduletest.Progress, _ int64) {\n\tswitch progress {\n\tcase moduletest.Starting, moduletest.Running, moduletest.TearDown:\n\t\treturn // We don't print progress updates in human mode\n\tcase moduletest.Complete:\n\t\t// Do nothing, the rest of the function handles this.\n\tdefault:\n\t\tpanic(\"unrecognized test progress: \" + progress.String())\n\t}\n\n\tt.view.streams.Printf(\"  run %q... %s\\n\", run.Name, colorizeTestStatus(run.Status, t.view.colorize))\n\n\tif run.Verbose != nil {\n\t\t// We're going to be more verbose about what we print, here's the plan\n\t\t// or the state depending on the type of run we did.","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/hashicorp/terraform/blob/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/command/views/test.go#L143-L179","documentation":"TestHuman.File (internal/command/views/test.go:155) switches over moduletest.Progress and panics 'unrecognized test progress' for any value outside Starting/Running/TearDown/Complete. moduletest.Progress is an iota enum (progress.go:14-18) with exactly those four members.","triggerScenarios":"The test runner emits a moduletest.Progress value outside the four defined constants — only possible if a new Progress member is added (e.g. a 'Setup' phase) without updating this switch, or if a corrupted/zero-value Progress reaches the view.","commonSituations":"Extending the test lifecycle with a new progress phase and forgetting the human-view branch; an internal regression producing an uninitialised Progress.","solutions":["When adding a moduletest.Progress constant, update TestHuman.File (and the JSON/TestJSON variants and json.ToTestProgress) in the same change.","Regenerate the stringer and add an exhaustive test over Progress values through the view layer.","Guard upstream so Progress is never zero/unset before the view is called.","As an end user this is an internal Terraform bug — report it with the 'terraform test' run details."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"func validProgress(p moduletest.Progress) bool {\n    switch p {\n    case moduletest.Starting, moduletest.Running, moduletest.TearDown, moduletest.Complete:\n        return true\n    }\n    return false\n}\nif !validProgress(progress) {\n    return fmt.Errorf(\"unsupported test progress %q\", progress)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When extending moduletest.Progress, update File/Run for both human and JSON views plus json.ToTestProgress in one change.","Add an exhaustive test that feeds every Progress constant through the view layer.","Never pass a zero-value Progress to the view; initialise it to Starting."],"tags":["panic","exhaustive-switch","test-command","enum","progress","internal-bug"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}