Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve unit test coverage #843

Closed
sbueringer opened this issue Apr 9, 2021 · 11 comments
Closed

Improve unit test coverage #843

sbueringer opened this issue Apr 9, 2021 · 11 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@sbueringer
Copy link
Member

/kind feature

We now have e2e / integration / conformance tests but basically zero unit tests. I think we should change that.
I think we need at least unit tests on 2 layers:

  • CAPO controllers
  • OpenStack / gophercloud utils

I would start with an initial implementation to establish patterns how we do unit tests for those layers

Some considerations:

  • controller-runtime: fakeclient vs envtest
  • how to mock gophercloud
  • how to unit test gophercloud

Notes:

  • I expect that we have to refactor some of our code to reduce the complexity and make it unit-testable (we can probably adjust the gocyclo linter to about 10-20 (only if appropriate))

After the initial implementation I would create a list of additional unit tests for follow-up PRs, which I would then flag with help wanted / good first issue.

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 9, 2021
@sbueringer
Copy link
Member Author

sbueringer commented Apr 9, 2021

/assign
(already have a lot of experience with CAPI unit tests and the controller-runtime test framework)

@sbueringer
Copy link
Member Author

/unassign

Didn't have time for this. So let's see if somebody wants to pick it up until the next minor release

@sbueringer sbueringer changed the title v1alpha4: Improve unit test coverage Improve unit test coverage Jun 29, 2021
@sbueringer
Copy link
Member Author

Related to this slack conversation: https://kubernetes.slack.com/archives/CFKJB65G9/p1623237546041600

@macaptain just fyi, this is the corresponding issue :)

Are you currently on it?

@macaptain
Copy link
Contributor

@sbueringer, yes I was hoping to have a go this week.

/assign

@sbueringer
Copy link
Member Author

@macaptain Perfect, great!

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 28, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 28, 2021
@tobiasgiese
Copy link
Member

@macaptain are you still on this?

@macaptain
Copy link
Contributor

@tobiasgiese, I completed an initial implementation of mocking the OpenStack API to support unit tests in CAPO (#935).

Per the issue description:

After the initial implementation I would create a list of additional unit tests for follow-up PRs, which I would then flag with help wanted / good first issue.

I expect we could do this now. @mdbooth had a really promising draft #1030 mocking out the interfaces in the compute module which would also help!

/unassign

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closing this issue.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

5 participants