Skip to content

fake client for unit testing #524

Open
@kevingessner

Description

@kevingessner

Kubernetes's client-go includes a powerful "fake" library (https://godoc.org/k8s.io/client-go/kubernetes/fake), which provides a mock API client that handles reads and writes without a cluster. It enables unit testing of code that uses client-go. This blog post has examples of how it's used: https://medium.com/@e_frogers/unit-testing-with-kubernetes-client-go-283b11aaa7db

Could this library provide a similar mock interface? I think a fake kubernetes.client.ApiClient that works in-process instead of over HTTP (like the go fake client) would be perfect: it would be injectable into the existing clients to allow full testing.

Metadata

Metadata

Assignees

Labels

lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions