{"record":{"id":"e4557c065b9a54d5","repo":"GoogleContainerTools/skaffold","slug":"custom-test-command-must-not-be-empty","errorCode":null,"errorMessage":"custom test command must not be empty;","messagePattern":"custom test command must not be empty;","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/schema/validation/validation.go","lineNumber":802,"sourceCode":"\n\tfor _, a := range acs {\n\t\tif a.ExecutionModeConfig.KubernetesClusterExecutionMode != nil && a.ExecutionModeConfig.LocalExecutionMode != nil {\n\t\t\terrs = append(errs, fmt.Errorf(\"custom action %s have more than one execution mode defined. custom actions must have only one execution mode\", a.Name))\n\t\t}\n\t}\n\n\treturn\n}\n\n// validateCustomTest\n// - makes sure that command is not empty\n// - makes sure that dependencies.ignore is only used in conjunction with dependencies.paths\nfunc validateCustomTest(cfg *parser.SkaffoldConfigEntry, tcs []*latest.TestCase) (cfgErrs []ErrorWithLocation) {\n\tfor i, tc := range tcs {\n\t\tfor j, ct := range tc.CustomTests {\n\t\t\tif ct.Command == \"\" {\n\t\t\t\tcfgErrs = append(cfgErrs, ErrorWithLocation{\n\t\t\t\t\tError:    fmt.Errorf(\"custom test command must not be empty;\"),\n\t\t\t\t\tLocation: cfg.YAMLInfos.Locate(&cfg.Test[i].CustomTests[j]),\n\t\t\t\t})\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif ct.Dependencies == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif ct.Dependencies.Command != \"\" && ct.Dependencies.Paths != nil {\n\t\t\t\tcfgErrs = append(cfgErrs, ErrorWithLocation{\n\t\t\t\t\tError:    fmt.Errorf(\"dependencies can use either command or paths, but not both\"),\n\t\t\t\t\tLocation: cfg.YAMLInfos.Locate(&cfg.Test[i].CustomTests[j]),\n\t\t\t\t})\n\t\t\t}\n\t\t\tif ct.Dependencies.Paths == nil && ct.Dependencies.Ignore != nil {\n\t\t\t\tcfgErrs = append(cfgErrs, ErrorWithLocation{\n\t\t\t\t\tError:    fmt.Errorf(\"customTest has invalid dependencies; dependencies.ignore can only be used in conjunction with dependencies.paths\"),\n\t\t\t\t\tLocation: cfg.YAMLInfos.Locate(&cfg.Test[i].CustomTests[j]),","sourceCodeStart":784,"sourceCodeEnd":820,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/schema/validation/validation.go#L784-L820","documentation":"Validation error from validateCustomTest: a `custom` test entry in skaffold.yaml's test section defines an empty command. Custom tests must specify the command to execute; the error is reported with the YAML location of the offending custom test.","triggerScenarios":"Processing a skaffold.yaml (via ProcessToErrorWithLocation) where any test case's customTests entry has `command: \"\"` or omits `command`.","commonSituations":"Adding a customTest stanza and forgetting the command; a variable/template expansion that resolves to empty; commenting out the command line while leaving the entry.","solutions":["Set a non-empty command string on the customTest entry","Remove the empty customTest entry if it is not needed","Check the YAML location reported in the error to find the exact offending entry"],"exampleFix":"# before\ntest:\n- customTests:\n  - command: \"\"\n# after\ntest:\n- customTests:\n  - command: \"./scripts/run-custom-tests.sh\"","handlingStrategy":"validation","validationCode":"func requireCommand(tc TestCase) error {\n\tfor _, ct := range tc.CustomTests {\n\t\tif strings.TrimSpace(ct.Command) == \"\" {\n\t\t\treturn fmt.Errorf(\"customTest %v has empty command\", tc)\n\t\t}\n\t}\n\treturn nil\n}","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Always fill command when adding a customTest entry","If command comes from a variable, assert it is non-empty before rendering","Remove disabled customTests instead of blanking their command"],"tags":["skaffold","yaml-validation","custom-test","empty-value"],"backgroundTag":"schema-validation-failed","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}