Skip to content

Improve pkg/controller/revision/revision.go coverage #1150

@mattmoor

Description

@mattmoor

Move these to a helpers.go, and coverage in helpers_test.go:

  • getDeploymentProgressCondition could use focused unit testing,
  • getRevisionLastTransitionTime could use focused unit testing,
  • getBuildDoneCondition could use focused unit testing,
  • isBuildDone could use focused unit testing

addDeploymentProgressEvent needs coverage for most of its body.

removeFinalizers needs coverage for most of its body.

The logger.Errorf before many return err amplifies the lack of coverage along error paths. The runtime.HandleError pattern is similar, but less pronounced (probably not worth a helper).

This path seems easy to cover in addEndpointsEvent:

if revisionAge < serviceTimeoutDuration {
    return
}

Metadata

Metadata

Assignees

Labels

area/APIAPI objects and controllersarea/buildBuild topics specifically related to Knativekind/featureWell-understood/specified features, ready for coding.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions