Closed jooola closed 3 months ago
Attention: Patch coverage is 0%
with 20 lines
in your changes are missing coverage. Please review.
Project coverage is 70.54%. Comparing base (
a61c494
) to head (0f02426
).
Files | Patch % | Lines |
---|---|---|
hcloud/exp/hcloudmock/client.go | 0.00% | 20 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I started implementing the new mocks in the CLI: https://github.com/hetznercloud/cli/commit/43295830767194d1aaa7ff680d11223c08716e4b
It saves us quite a bit of code there. Although it would be nicer if we had a unified interface that the mock client would implement and also a wrapper for the regular hcloud-go client that has those methods, like we do in the hcapi2
package in the cli.
On a side note, I think the package name mock
is a bit too generic and could cause some collisions. I still think it's a very good idea to put this logic into hcloud-go instead of cluttering other integrations with it.
Although it would be nicer if we had a unified interface that the mock client would implement and also a wrapper for the regular hcloud-go client that has those methods, like we do in the hcapi2 package in the cli.
I am not sure to fully understand your suggestions, could you elaborate please?
Implementing a mock for the client will be on hold until we can implement an interface first client. The current struct based client does not allow us to swap the client implementation (real and mock) easily.
This adds a generated mock for the
hcloudmock.Client
that will be usable for external library for testing.