Uploaded image for project: 'OpenShift GitOps'
  1. OpenShift GitOps
  2. GITOPS-5619

Improve image-updater unit tests for pkg/registry/client.go

XMLWordPrintable

    • GitOps Tangerine - Sprint 3263

      Story (Required)

      As a developer using image-updater, I want to make sure all packages and commands are fully tested.  We should add tests to verify their expected behavior.

      Describe the bug
      According to the test coverage report at https://app.codecov.io/gh/argoproj-labs/argocd-image-updater/blob/master/pkg%2Fregistry%2Fclient.go , some important code paths are not covered in function:

      func (client *registryClient) TagMetadata(manifest distribution.Manifest, opts *options.ManifestOptions) (*tag.TagInfo, error) {

      Need to add tests for those code paths in https://github.com/argoproj-labs/argocd-image-updater/blob/master/pkg/registry/client.go#L198

      Acceptance Criteria (Mandatory)

      • analyze the current unit test coverage in pkg/registry/client.go
      • add unit tests so that all testable code paths are covered
      • code blocks that are not testable by unit tests under the current testing framework can be exempted
         

      INVEST Checklist

      Dependencies identified

      Blockers noted and expected delivery timelines set

      Design is implementable

      Acceptance criteria agreed upon

      Story estimated

      Legend

      Unknown

      Verified

      Unsatisfied

      Done Checklist

      • Code is completed, reviewed, documented and checked in
      • Unit and integration test automation have been delivered and running cleanly in continuous integration/staging/canary environment
      • Continuous Delivery pipeline(s) is able to proceed with new code included
      • Customer facing documentation, API docs etc. are produced/updated, reviewed and published
      • Acceptance criteria are met

              cfang@redhat.com Cheng Fang
              cfang@redhat.com Cheng Fang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: