diff --git a/pkg/skaffold/runner/new.go b/pkg/skaffold/runner/new.go index 750bf080661..c78417f84a0 100644 --- a/pkg/skaffold/runner/new.go +++ b/pkg/skaffold/runner/new.go @@ -52,13 +52,26 @@ func NewForConfig(runCtx *runcontext.RunContext) (*SkaffoldRunner, error) { return nil, fmt.Errorf("parsing build config: %w", err) } + tester := getTester(runCtx) + syncer := getSyncer(runCtx) + imagesAreLocal := false if localBuilder, ok := builder.(*local.Builder); ok { imagesAreLocal = !localBuilder.PushImages() } depLister := func(ctx context.Context, artifact *latest.Artifact) ([]string, error) { - return build.DependenciesForArtifact(ctx, artifact, runCtx.InsecureRegistries) + buildDependencies, err := build.DependenciesForArtifact(ctx, artifact, runCtx.InsecureRegistries) + if err != nil { + return nil, err + } + + testDependencies, err := tester.TestDependencies() + if err != nil { + return nil, err + } + + return append(buildDependencies, testDependencies...), nil } artifactCache, err := cache.NewCache(runCtx, imagesAreLocal, depLister) @@ -66,9 +79,6 @@ func NewForConfig(runCtx *runcontext.RunContext) (*SkaffoldRunner, error) { return nil, fmt.Errorf("initializing cache: %w", err) } - tester := getTester(runCtx) - syncer := getSyncer(runCtx) - deployer, err := getDeployer(runCtx) if err != nil { return nil, fmt.Errorf("parsing deploy config: %w", err)