Skip to content

Add taskevents Test, StatusCheck, and fix duplicates for Deploy #5675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions pkg/skaffold/runner/build_deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,18 @@ func (r *SkaffoldRunner) Build(ctx context.Context, out io.Writer, artifacts []*

// Test tests a list of already built artifacts.
func (r *SkaffoldRunner) Test(ctx context.Context, out io.Writer, artifacts []graph.Artifact) error {
eventV2.TaskInProgress(constants.Test, r.devIteration)
if err := r.tester.Test(ctx, out, artifacts); err != nil {
eventV2.TaskFailed(constants.Test, r.devIteration, err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This will not add event per tester right? We can add those later in a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, this is just for the over arching test phase

return err
}

eventV2.TaskSucceeded(constants.Test, r.devIteration)
return nil
}

// DeployAndLog deploys a list of already built artifacts and optionally show the logs.
func (r *SkaffoldRunner) DeployAndLog(ctx context.Context, out io.Writer, artifacts []graph.Artifact) error {
eventV2.TaskInProgress(constants.Deploy, r.devIteration)

// Update which images are logged.
r.addTagsToPodSelector(artifacts)

Expand All @@ -121,7 +122,6 @@ func (r *SkaffoldRunner) DeployAndLog(ctx context.Context, out io.Writer, artifa
logger.SetSince(time.Now())
// First deploy
if err := r.Deploy(ctx, out, artifacts); err != nil {
eventV2.TaskFailed(constants.Deploy, r.devIteration, err)
return err
}

Expand All @@ -134,7 +134,6 @@ func (r *SkaffoldRunner) DeployAndLog(ctx context.Context, out io.Writer, artifa

// Start printing the logs after deploy is finished
if err := logger.Start(ctx, r.runCtx.GetNamespaces()); err != nil {
eventV2.TaskFailed(constants.Deploy, r.devIteration, err)
return fmt.Errorf("starting logger: %w", err)
}

Expand All @@ -143,7 +142,6 @@ func (r *SkaffoldRunner) DeployAndLog(ctx context.Context, out io.Writer, artifa
<-ctx.Done()
}

eventV2.TaskSucceeded(constants.Deploy, r.devIteration)
return nil
}

Expand Down
3 changes: 3 additions & 0 deletions pkg/skaffold/runner/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,17 @@ func (r *SkaffoldRunner) performStatusCheck(ctx context.Context, out io.Writer)
return nil
}

eventV2.TaskInProgress(constants.StatusCheck, r.devIteration)
start := time.Now()
color.Default.Fprintln(out, "Waiting for deployments to stabilize...")

s := newStatusCheck(r.runCtx, r.labeller)
if err := s.Check(ctx, out); err != nil {
eventV2.TaskFailed(constants.StatusCheck, r.devIteration, err)
return err
}

color.Default.Fprintln(out, "Deployments stabilized in", util.ShowHumanizeTime(time.Since(start)))
eventV2.TaskSucceeded(constants.StatusCheck, r.devIteration)
return nil
}