Add unit tests for installrecipe.go part 1#992
Conversation
|
Hi @bromivipo. Thanks for your PR. I'm waiting for a GoogleCloudPlatform member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
| t.Fatalf("failed to add initial recipe: %v", err) | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
can this be moved to a test setup?
There was a problem hiding this comment.
moved it to a separate function
| db, err := newRecipeDB() | ||
| if err != nil { | ||
| t.Fatalf("failed to read db after install: %v", err) | ||
| } |
There was a problem hiding this comment.
can this be moved out of testing loop?
There was a problem hiding this comment.
moved it to separate function
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: bromivipo, iliatsuprik The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
New changes are detected. LGTM label has been removed. |
| setupTestDB(t) | ||
| populateInitialRecipes(t, tt.initialRecipes) | ||
|
|
||
| err := InstallRecipe(ctx, tt.recipe) |
There was a problem hiding this comment.
please change to gotErr
There was a problem hiding this comment.
changed it and refactored the test a bit
This PR contains DesiredStateHandling tests for InstallRecipe func in policies/recipes/installrecipe.go
coverage 0 -> 64.1%