Skip to content

Move versionchecker tests to test/integration#4728

Merged
jetstack-bot merged 1 commit intocert-manager:masterfrom
SgtCoDFish:moveversionchecker
Jan 13, 2022
Merged

Move versionchecker tests to test/integration#4728
jetstack-bot merged 1 commit intocert-manager:masterfrom
SgtCoDFish:moveversionchecker

Conversation

@SgtCoDFish
Copy link
Copy Markdown
Member

Since some of these version checker tests require setup before they can successfully run, we define them as integration tests and move them here so that on a fresh checkout a user can always run go test ./pkg/... and expect that it would succeed.

There are other tests which need to be moved, but I've separated this one out.

Also involves:

  • Exporting VersionChecker and adding NewFromClient to enable testing.
  • Some comment changes
  • A change to the type returned by New(); see CodeReviewComments

Notes for Reviewers

  • I don't really want to add NewFromClient but I think it's the most minimal change and is preferable to publicly exporting VersionChecker.client.
  • I don't think versionchecker.Interface needs to exist but I don't want to go off track and remove it

/kind cleanup

NONE

Since this test requires setup before it can successfully run,
we define it as an integration test and move it here so that on a
fresh checkout a user can always run `go test ./pkg/...` and expect that
it would succeed.

Also involves:

- Exporting the VersionChecker and adding NewWithConfig to enable
  testing
- Some comment changes
- A change to the type returned by New(); see
  https://github.com/golang/go/wiki/CodeReviewComments#interfaces

Ideally I'd not add `NewFromClient` but I think it's the most minimal
change and is preferable to publicly exporting `VersionChecker.client`.

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
@jetstack-bot jetstack-bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/testing Issues relating to testing approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 12, 2022
Copy link
Copy Markdown
Contributor

@irbekrm irbekrm left a comment

Choose a reason for hiding this comment

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

This makes sense to me and looks straightforward, I've ran go test ./pkg/... from this branch and now the only thing that fails is the dns integration test 👍🏼

Thanks for linking this, I'd been wanting to find some 'official' place where this principle is written down

Ideally I'd not add NewFromClient but I think it's the most minimal
change and is preferable to publicly exporting VersionChecker.client.

Agree that there are probably more elegant ways to do this that aren't worth implementing for this one use case 👍🏼

/lgtm

@jetstack-bot jetstack-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 13, 2022
@jetstack-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: irbekrm, SgtCoDFish

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jetstack-bot jetstack-bot merged commit 4d5058a into cert-manager:master Jan 13, 2022
@jetstack-bot jetstack-bot added this to the v1.7 milestone Jan 13, 2022
@SgtCoDFish SgtCoDFish mentioned this pull request Jan 13, 2022
30 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/testing Issues relating to testing dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants