GoogleContainerTools/skaffold · error

customTest has invalid dependencies; dependencies.ignore can

Error message

customTest has invalid dependencies; dependencies.ignore can only be used in conjunction with dependencies.paths

What it means

Validation error from validateCustomTest: a custom test sets dependencies.ignore without dependencies.paths. Ignore patterns are only meaningful as filters over an explicit paths list, so the combination is rejected with the test's YAML location.

Source

Thrown at pkg/skaffold/schema/validation/validation.go:819

				cfgErrs = append(cfgErrs, ErrorWithLocation{
					Error:    fmt.Errorf("custom test command must not be empty;"),
					Location: cfg.YAMLInfos.Locate(&cfg.Test[i].CustomTests[j]),
				})
				return
			}

			if ct.Dependencies == nil {
				continue
			}
			if ct.Dependencies.Command != "" && ct.Dependencies.Paths != nil {
				cfgErrs = append(cfgErrs, ErrorWithLocation{
					Error:    fmt.Errorf("dependencies can use either command or paths, but not both"),
					Location: cfg.YAMLInfos.Locate(&cfg.Test[i].CustomTests[j]),
				})
			}
			if ct.Dependencies.Paths == nil && ct.Dependencies.Ignore != nil {
				cfgErrs = append(cfgErrs, ErrorWithLocation{
					Error:    fmt.Errorf("customTest has invalid dependencies; dependencies.ignore can only be used in conjunction with dependencies.paths"),
					Location: cfg.YAMLInfos.Locate(&cfg.Test[i].CustomTests[j]),
				})
			}
		}
	}
	return
}

func wrapWithContext(config *parser.SkaffoldConfigEntry, errs ...ErrorWithLocation) []ErrorWithLocation {
	var id string
	if config.Metadata.Name != "" {
		id = fmt.Sprintf("in module %q", config.Metadata.Name)
	} else {
		id = fmt.Sprintf("in unnamed config[%d]", config.SourceIndex)
	}

	for i := range errs {
		if errs[i].Location == nil || errs[i].Location.StartLine == -1 {

View on GitHub (pinned to a1189de023)

Solutions

  1. Add a `paths` list alongside `ignore`, or remove the `ignore` field if using command-based dependencies
  2. Keep ignore only as a filter of the paths set
  3. Validate the dependencies block against the skaffold schema before running

Example fix

# before
- customTests:
  - command: ./run-tests.sh
    dependencies:
      command: ./list-deps.sh
      ignore: ["**/*_test.go"]
# after
- customTests:
  - command: ./run-tests.sh
    dependencies:
      paths: ["src/**"]
      ignore: ["**/*_test.go"]
Defensive patterns

Strategy: validation

Validate before calling

func ignoreNeedsPaths(ct CustomTest) error {
	d := ct.Dependencies
	if d != nil && len(d.Ignore) > 0 && d.Paths == nil {
		return fmt.Errorf("customTest dependencies.ignore requires dependencies.paths")
	}
	return nil
}

Type guard

null

Try / catch

null

Prevention

When it happens

Trigger: Processing a skaffold.yaml where a customTest's `dependencies:` block has `ignore:` set while `paths` is nil/absent (typically because only `command` is set).

Common situations: Copying an ignore list from another test that used paths; removing paths during a switch to command-based dependencies but leaving ignore behind; assuming ignore applies to command output too.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05). Data as JSON: /api/errors/18cb76b79bcd4279. Report an issue: GitHub.