unit tests for postgres cluster for helpers#1789
unit tests for postgres cluster for helpers#1789limak9182 wants to merge 5 commits intofeature/database-controllersfrom
Conversation
|
CLA Assistant Lite bot: I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request |
In general, all above come to choice and the decisions that we've made and are focused on sticking too. I would suggest Michał to take a look too. |
|
…to feature/postgrescluster-unit-tests
|
|
||
| func TestBuildCNPGClusterSpec(t *testing.T) { | ||
| r := &PostgresClusterReconciler{} | ||
|
|
There was a problem hiding this comment.
do we need to validate not only the basic CNPG cluster spec fields but also asserts propagation of class-level CNPG spec fields?
There was a problem hiding this comment.
I believe this unit test should be only responsible for testing this particular functionality, functional tests might cover the whole case of checking parameters between PostgresCluster and PostgresClusterClass.
| }) | ||
| } | ||
|
|
||
| func TestDeleteCNPGCluster(t *testing.T) { |
There was a problem hiding this comment.
do we need to check if delete returns an error?
There was a problem hiding this comment.
What I wanted to check here is the scenerio when the cluster was already deleted, we don't want an error here but just nil. In the future when this function might be modified we have an extra guard that our reconciliation logic relies on that.
Description
What does this PR have in it?
Key Changes
Highlight the updates in specific files
Testing and Verification
How did you test these changes? What automated tests are added?
Related Issues
Jira tickets, GitHub issues, Support tickets...
PR Checklist
Local testing: