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

Support client patch and delete collection requests for tests #202

Merged
merged 2 commits into from Apr 16, 2022

Conversation

scothis
Copy link
Contributor

@scothis scothis commented Apr 6, 2022

Reconcilers and sub-reconcilers can now make use of patch and delete
collection operations and test them like any other client request. Unlike
for operation that use the full object, type aware comparisons are not
available. The exact patch type and bytes called on the client must match
the expected values.

Resolves #192

Reconcilers can now make use of patch operations and test them like any
other client request. Unlike for operation that use the full object,
type aware comparisons are not available. The exact patch type and bytes
called on the client must match the expected values.

Expectations are now managed for delete collection operations.

Signed-off-by: Scott Andrews <andrewssc@vmware.com>
@scothis
Copy link
Contributor Author

scothis commented Apr 6, 2022

@mamachanko needs a bit of polish, but curious if this works for you

@codecov
Copy link

codecov bot commented Apr 6, 2022

Codecov Report

Merging #202 (d22aa01) into main (0248645) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #202   +/-   ##
=======================================
  Coverage   64.71%   64.71%           
=======================================
  Files           8        8           
  Lines         768      768           
=======================================
  Hits          497      497           
  Misses        256      256           
  Partials       15       15           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0248645...d22aa01. Read the comment docs.

@mamachanko
Copy link
Collaborator

mamachanko commented Apr 9, 2022

@mamachanko needs a bit of polish, but curious if this works for you

Nice!

I took it for a spin and, as far as I can tell, it performs as advertised. 🥳

However, it would be nice to have ExpectPatch available for SubReconcilerTestCase as well. Would that even be possible? @scothis

edit: updated after test

Signed-off-by: Scott Andrews <andrewssc@vmware.com>
@scothis
Copy link
Contributor Author

scothis commented Apr 14, 2022

@mamachanko added ExpectPatches and ExpectDeleteCollections to SubReconcilerTestSuite

@scothis scothis changed the title Support client patch requests for tests Support client patch and delete collection requests for tests Apr 16, 2022
@scothis scothis marked this pull request as ready for review April 16, 2022 15:56
@scothis scothis merged commit e62fea5 into vmware-labs:main Apr 16, 2022
@scothis scothis deleted the expect-patch branch April 16, 2022 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Testing client panics on Patch()
3 participants