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

OCM-7252 | feat: Move describe machinepool funcs to pkg, test, split up, make interface #1922

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

hunterkepley
Copy link
Contributor

@hunterkepley hunterkepley commented Apr 11, 2024

https://issues.redhat.com/browse/OCM-7252


    describeMachinePool
    describeNodePool
    formatNodePoolOutput

These functions should be decomposed to smaller functions where possible to ensure ease of Unit Testing

An interface for these functions should be created and mocks generated to enable ease of testing for the describe machine pool cmd.

DONE

    Functions have been moved to new machine pool package
    Functions test coverage is at least 70%
  • Move funcs to new pkg dir (pkg/machinepool)
  • Improve errors slightly (node pools returned machine pool in not found error)
  • Split up funcs where possible
  • Test as much as possible in pkg
  • Make interface + struct using interface
  • Prepare mocks

Copy link

codecov bot commented Apr 11, 2024

Codecov Report

Attention: Patch coverage is 63.36634% with 37 lines in your changes are missing coverage. Please review.

Project coverage is 21.69%. Comparing base (b3740fd) to head (47efbda).
Report is 4 commits behind head on master.

Files Patch % Lines
pkg/machinepool/machinepool.go 40.32% 35 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1922      +/-   ##
==========================================
- Coverage   21.77%   21.69%   -0.09%     
==========================================
  Files         118      118              
  Lines       19786    19797      +11     
==========================================
- Hits         4308     4294      -14     
- Misses      15152    15181      +29     
+ Partials      326      322       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hunterkepley
Copy link
Contributor Author

Coverage should jump up after next MR/ticket, which will include using the mocks + service interface to test the funcs used directly in the command which print, and do not provide returned output

@hunterkepley hunterkepley force-pushed the ocm-7252 branch 2 times, most recently from fe2d8d9 to 096e58d Compare April 11, 2024 19:07
@hunterkepley
Copy link
Contributor Author

Coverage should jump up after next MR/ticket, which will include using the mocks + service interface to test the funcs used directly in the command which print, and do not provide returned output

Cannot currently test these as the next MR includes a new runner+mocks, which are needed to run those funcs

@willkutler
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 11, 2024
@robpblake
Copy link
Contributor

This is nice work @hunterkepley 🚀

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 12, 2024
@hunterkepley
Copy link
Contributor Author

@robpblake changed back to machine pool in the not found message, PTAL

Copy link
Contributor

openshift-ci bot commented Apr 12, 2024

@hunterkepley: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@gdbranco
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 12, 2024
Copy link
Contributor

openshift-ci bot commented Apr 12, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gdbranco, hunterkepley, willkutler

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

The pull request process is described here

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 12, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 4ed4d73 into openshift:master Apr 12, 2024
9 checks passed
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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants