-
Notifications
You must be signed in to change notification settings - Fork 152
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 unit tests for kopia repository server controller(PR #2) #1997
Conversation
Thanks for submitting this pull request 🎉. The team will review it soon and get back to you. If you haven't already, please take a moment to review our project contributing guideline and Code of Conduct document. |
f06ac16
to
14bf4fb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we just want to test if the CR is getting into Created
state as part of this test?
e507fb3
to
590ea8c
Compare
22e6ddb
to
7a05062
Compare
pkg/controllers/repositoryserver/repositoryserver_controller_test.go
Outdated
Show resolved
Hide resolved
pkg/controllers/repositoryserver/repositoryserver_controller_test.go
Outdated
Show resolved
Hide resolved
pkg/controllers/repositoryserver/repositoryserver_controller_test.go
Outdated
Show resolved
Hide resolved
if podName and serviceName are not set even after the polling time exceeds
dc7b0c2
to
804cc77
Compare
@PrasadG193 @viveksinghggits can we merge this manually? This PR has been blocked for automatic merge. |
* add unit tests for repository server controller * test * add prerequisites for tests * add server ready test * remove unwanted changes * fix lint issues * automate creation of repo server CRD * address review comments * add symbolic link * address comments * remove custom resource * renaming cli to kubecli * add more tests * fix lint issue * Add tests for Immutability Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com> * Fix naming conventions Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com> * Update variables Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com> * add tests related to secrets * add secrets configuration for testutils * add base suite for repository server controller * use constants for location secret keys * add unit tests * make the constants local to the package * add licence headers * change package name * fix build errors * fix licence headers * fix lint issues * remove secret manager changes * remove unused functions and move to next PR * add utility functions * add tests for secrets and cache settings * fix build issues * move secret creation utils under test suite * resolve conflicts * add base suite for repository server controller * use constants for location secret keys * make the constants local to the package * add licence headers * fix licence headers * fix lint issues * remove unused functions and move to next PR * fix build issues * move secret creation utils under test suite * address review comments * add tests which got deleted during rebase * address review comments * updating tests to use the latest changed values for repository server progress field in status * move test utilities to pkg/testutil/testutil.go * rename kopia repository path constant name * improve tests and comments for better readability * refactor repository_test.go and secrets_manager_test.go for better readability * fix tests * test * fix tests * remove unnecessary whitespaces * rename conflicting env variables with s3compliant prefix * uncomment tests * move the env variable related comment at the right place * check error message for immuatability test * address comments related to better readability * change waitForRepoServerInfoUpdateInCR function to return error if podName and serviceName are not set even after the polling time exceeds --------- Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com> Co-authored-by: Rajat Gupta <37516416+r4rajat@users.noreply.github.com> Co-authored-by: Rajat Gupta <rajat.gupta@veeam.com>
Change Overview
This PR adds a suite for running unit tests for kopia repository server controller. This is in continuation with the
base suite PR #2100
In this PR we are checking following points
- Check if Server is created successfully and CR is in RepositoryServerReady after all the configurations are done correctly
- Check if Server goes into RepositoryServerStopped state when secrets are not provided in CR
- Immutability of certain fields in the CR - update of CR for certain fields should not be allowed
- Check if repository server pod and service are getting created after creating the CR
- Check Repository Connect failures if the secrets are configured incorrectly
- Check what cachesizesettings are passed to kopia when the CR is configured with cachesizesettings field
- Test fetching of repository server secrets in the controller
Pull request type
Please check the type of change your PR introduces:
Issues
Test Plan
Test Result:
https://gist.github.com/kale-amruta/a2e9f6402196027af398bded26c46247