-
Notifications
You must be signed in to change notification settings - Fork 115
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
Develop a unit test suite for Kubernetes provider #2767
Labels
Comments
14 tasks
EronWright
added a commit
that referenced
this issue
Jan 26, 2024
<!--Thanks for your contribution. See [CONTRIBUTING](CONTRIBUTING.md) for Pulumi's contribution guidelines. Help us merge your changes more quickly by adding more details such as labels, milestones, and reviewers.--> ### Proposed changes This PR implements a suite of unit tests for the provider implementation code in `provider/pkg/provider/provider.go`. Unlike the test suites in `tests/`, this suite uses a mock Kubernetes client and executes the provider code directly. This PR focuses on the provider lifecycle (e.g. plugin info and provider configuration): - [x] Suite - [x] RPC:CheckConfig - [x] Strict Mode - [x] Yaml Rendering Mode - [x] RPC:DiffConfig - [x] Kubeconfig Parsing - [x] Cluster Change Detection - [x] RPC:Configure - [x] Secrets Support - [x] Connectivity - [x] RPC:GetPluginInfo - [x] RPC:GetSchema - [x] RPC:GetMapping - [x] RPC:Cancel In follow-up PR(s), tests will be developed for the resource lifecycle (eg. `Check`, `Diff`, `Read`, `Create`, `Update`, `Delete`), and for invokes (`Invoke`, `StreamInvoke`). ### Changes to Implementation Code Some minor refactoring was necessary to make it possible to substitute fake Kubernetes clients. - the type of the `RESTMapper` field of `DynamicClientSet` was changed to an interface. - the type of the `client` field of `LogClient` was changed to an interface. - the low-level logic for making a Kubernetes client from a kubeconfig was moved into a function called `makeClient`. - add a `makeClient` field to `kubeProvider` as an indirection for test purposes. Closes #2767
Cannot close issue:
Please fix these problems and try again. |
This was referenced Jun 10, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Develop a unit test suite for the Kubernetes provider, based on the following principles:
kubeProvider
implementation code, not via the Pulumi CLI.For scoping, focus on building up a framework and on basic coverage that would benefit other upcoming issues.
The text was updated successfully, but these errors were encountered: