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
}
Move these to a
helpers.go, and coverage inhelpers_test.go:getDeploymentProgressConditioncould use focused unit testing,getRevisionLastTransitionTimecould use focused unit testing,getBuildDoneConditioncould use focused unit testing,isBuildDonecould use focused unit testingaddDeploymentProgressEventneeds coverage for most of its body.removeFinalizersneeds coverage for most of its body.The
logger.Errorfbefore manyreturn erramplifies the lack of coverage along error paths. Theruntime.HandleErrorpattern is similar, but less pronounced (probably not worth a helper).This path seems easy to cover in
addEndpointsEvent: