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

✨ Add envtest setup and controller tests #10

Merged
merged 2 commits into from
Oct 5, 2023
Merged

✨ Add envtest setup and controller tests #10

merged 2 commits into from
Oct 5, 2023

Conversation

janiskemper
Copy link
Member

What this PR does / why we need it:
Adding the envtest setup, that can be triggered by a Make target and allows unit tests for the controllers.

Adding a test provider objects
TestInfrastructureProviderClusterStackReleaseTemplate to make unit tests indepedent of any specific provider.

Adding mocking setup to generate mocks for the interfaces which can be used in unit testing. Adding mocks for Github client and for the kube client.

Adding utils package for testing that contains utility functions to work with conditions and checks whether certain objects have a specific condition and how its properties look like.

Adding local cluster stacks that have been downloaded from Github SovereignCloudStack/cluster-stacks repository to make unit tests independent of another repository and make it possible to run them locally.

Adding unit tests to CI.

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 #9

TODOs:

  • squash commits
  • include documentation
  • add unit tests

Adding the envtest setup, that can be triggered by a Make target and
allows unit tests for the controllers.

Adding a test provider objects
TestInfrastructureProviderClusterStackReleaseTemplate to make unit tests
indepedent of any specific provider.

Adding mocking setup to generate mocks for the interfaces which can be
used in unit testing. Adding mocks for Github client and for the kube
client.

Adding utils package for testing that contains utility functions to work
with conditions and checks whether certain objects have a specific
condition and how its properties look like.

Adding local cluster stacks that have been downloaded from Github
SovereignCloudStack/cluster-stacks repository to make unit tests
independent of another repository and make it possible to run them
locally.

Adding unit tests to CI.

Signed-off-by: janiskemper <janis.kemper@syself.com>
@janiskemper janiskemper merged commit 168960c into main Oct 5, 2023
6 checks passed
@janiskemper janiskemper deleted the envtest branch October 5, 2023 12:16
janiskemper pushed a commit that referenced this pull request Nov 28, 2023
@jschoone jschoone added the Container Issues or pull requests relevant for Team 2: Container Infra and Tooling label Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Container Issues or pull requests relevant for Team 2: Container Infra and Tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Kubernetes Controller Tests with envtest from controller-runtime
3 participants