-
Notifications
You must be signed in to change notification settings - Fork 22
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
refactor: task status file #355
refactor: task status file #355
Conversation
771cd7c
to
9c533b8
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #355 +/- ##
==========================================
+ Coverage 11.28% 12.53% +1.24%
==========================================
Files 19 20 +1
Lines 2021 2003 -18
==========================================
+ Hits 228 251 +23
+ Misses 1793 1752 -41 ☔ View full report in Codecov by Sentry. |
9c533b8
to
986b2ab
Compare
/retest |
986b2ab
to
004c55a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in PR name: "refacotr: ..."
/retest |
/ok-to-test |
/lgtm |
18525a6
to
ba9b19d
Compare
The ctx passed into WaitForTaskToSucceed is only used to cancel HTTP reqests and not to cancel the wait.
ba9b19d
to
946d1c2
Compare
/approve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
/meow
In response to this:
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. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: adiantum, dkoshkin, thunderboltsid 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 |
5fd7ada
into
nutanix-cloud-native:main
* test: add unit tests for pkg/client/state * refactor: use wait.Poll function waiting for task state * refactor: use consistent task status names * fixup! test: add unit tests for pkg/client/state * fix: revert to previous behaviod polling forever The ctx passed into WaitForTaskToSucceed is only used to cancel HTTP reqests and not to cancel the wait. * chore: add license headers * fix: better function name
* test: add unit tests for pkg/client/state * refactor: use wait.Poll function waiting for task state * refactor: use consistent task status names * fixup! test: add unit tests for pkg/client/state * fix: revert to previous behaviod polling forever The ctx passed into WaitForTaskToSucceed is only used to cancel HTTP reqests and not to cancel the wait. * chore: add license headers * fix: better function name
* test: add unit tests for pkg/client/state * refactor: use wait.Poll function waiting for task state * refactor: use consistent task status names * fixup! test: add unit tests for pkg/client/state * fix: revert to previous behaviod polling forever The ctx passed into WaitForTaskToSucceed is only used to cancel HTTP reqests and not to cancel the wait. * chore: add license headers * fix: better function name
* fix: improve error handling for Prism Client (#354) * fix: use wrapper errors to clearly denote issues in client building * fix: adds a function to properly sanitize the address * fix: adds tests for ip address case given * fix: uses a defined type for port error * fix: clean up variable naming * fix: remove validation here to be moved into prism-client * refactor: task status file (#355) * test: add unit tests for pkg/client/state * refactor: use wait.Poll function waiting for task state * refactor: use consistent task status names * fixup! test: add unit tests for pkg/client/state * fix: revert to previous behaviod polling forever The ctx passed into WaitForTaskToSucceed is only used to cancel HTTP reqests and not to cancel the wait. * chore: add license headers * fix: better function name * refactor: client.go file helper methods (#360) * refactor: client.go file helper methods Refactored the existing methods and functions to be unit testable. Also made some methods that do not use the struct as generic functions. The changes were primarily an effort to add unit test coverage. * refactor: more testable read file function * test: new nutanixcluster types unit tests * test: additional test cases for errors * fixup! refactor: client.go file helper methods * fixup! refactor: client.go file helper methods * fixup! refactor: more testable read file function * fixup! refactor: client.go file helper methods * Switch Nutanix Client to using Session Auth (#398) This will ensure we make fewer basic auth requests to Prism Central IAM Services. --------- Co-authored-by: Faiq <faiq.raza@nutanix.com> Co-authored-by: Dimitri Koshkin <dimitri.koshkin@nutanix.com>
What this PR does / why we need it:
This started as an effort to start increasing the code coverage, but noticed that there was some code we can remove and instead rely on the apimachine
wait
helper functions.notice how only the error message with the timeout changed, all other tests cases stayed the same, all tests stayed the same after the refactor)Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
How Has This Been Tested?:
New unit tests
Special notes for your reviewer:
I broke up the PR into logical commits and would recommend reviewing it that way too.
I initially started by trying to mock the client but the is a bug that prevented me from doing that nutanix-cloud-native/prism-go-client#150. I went with the http route based on the client's own test files https://github.com/nutanix-cloud-native/prism-go-client/blob/main/v3/v3_service_test.go, but can refactor back to using mocks if we find that to be easier to maintain, if/when the bug PR is merged and released.
Release note: