GoogleContainerTools/skaffold · error

verify command expects non-zero number of test cases

Error message

verify command expects non-zero number of test cases

What it means

Skaffold's `verify` command runs verification test cases (containers that check deployed workloads). Before executing, schema validation checks that at least one `verify` test case is defined across all pipelines in skaffold.yaml. If the command is `verify` but `pipeline.Verify` is empty for every pipeline, this error is thrown because there is nothing to verify.

Source

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

		}
		networkModeCfgErr := ErrorWithLocation{
			Error:    networkModeErr,
			Location: cfg.YAMLInfos.LocateField(cfg.Build.Artifacts[i].DockerArtifact, "NetworkMode"),
		}
		cfgErrs = append(cfgErrs, networkModeCfgErr)
	}
	return
}

// Validate that test cases exist when `verify` is called, otherwise Skaffold should error
func validateVerifyTestsExistOnVerifyCommand(runCtx *runcontext.RunContext) []error {
	var errs []error
	tcs := []*latest.VerifyTestCase{}
	for _, pipeline := range runCtx.GetPipelines() {
		tcs = append(tcs, pipeline.Verify...)
	}
	if len(tcs) == 0 && runCtx.Opts.Command == "verify" {
		errs = append(errs, errors.New("verify command expects non-zero number of test cases"))
	}
	return errs
}

// Validates that a Docker Container with a Network Mode "container:<id|name>" points to an actually running container
func validateDockerNetworkContainerExists(ctx context.Context, artifacts []*latest.Artifact, runCtx docker.Config) []error {
	var errs []error
	apiClient, err := docker.NewAPIClient(ctx, runCtx)
	if err != nil {
		errs = append(errs, err)
		return errs
	}

	client := apiClient.RawClient()
	ctx, cancel := context.WithDeadline(ctx, time.Now().Add(5*time.Second))
	defer cancel()

	for _, a := range artifacts {

View on GitHub (pinned to a1189de023)

Solutions

  1. Add at least one entry under `verify:` in your skaffold.yaml defining a container test case (name + image).
  2. If you meant to run render/dev/deploy, run the matching command instead of `verify`.
  3. Check that the profile/config being activated (via -p or -f) actually contains the verify test cases.
  4. Fix any YAML key misspellings so the verify cases parse into pipeline.Verify.

Example fix

# before
apiVersion: skaffold/v4beta7
kind: Config
deploy:
  kubectl: {}
# after
apiVersion: skaffold/v4beta7
kind: Config
deploy:
  kubectl: {}
verify:
  - name: smoke-test
    container:
      image: busybox
      command: ["sh", "-c", "curl -f http://myservice:8080/health"]
Defensive patterns

Strategy: validation

Validate before calling

const cfg = yaml.parse(fs.readFileSync('skaffold.yaml', 'utf8'));
const tcs = (cfg.verify ?? []).length + (cfg.profiles ?? []).flatMap(p => p.verify ?? []).length;
if (process.argv.includes('verify') && tcs === 0) throw new Error('skaffold verify requires at least one verify test case');

Prevention

When it happens

Trigger: Running `skaffold verify` with a skaffold.yaml that has no `verify:` section (or an empty `verify:` list) in any pipeline.

Common situations: Developers switching from `skaffold test` to `skaffold verify` without translating tests into `verify` test cases; multi-config profiles where the activated profile omits verify cases; typos like `verfiy:` or nesting `verify` under the wrong pipeline key.

Related errors


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