Skip to content

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

Closed

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
}

Activity

  1. added
    area/API
    area/build
    kind/feature
    on Jun 12, 2018
  2. changed the title [-]Improve pkg/controller/revision/revision.go converage[/-] [+]Improve pkg/controller/revision/revision.go coverage[/+] on Jun 12, 2018
  3. mattmoor commented on Jun 12, 2018

    @mattmoor
    ContributorAuthor

    Once #1166 lands, I think the biggest coverage gap is removeFinalizers, at which point it is likely safe to resolve this.

  4. mattmoor commented on Jun 12, 2018

    @mattmoor
    ContributorAuthor

    removeFinalizers looks unused, so I'm just removing it: #1173

  5. mattmoor commented on Jun 12, 2018

    @mattmoor
    ContributorAuthor

    We should be in reasonable shape here.

  6. added a commit that references this issue on Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/APIarea/buildkind/feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions