-
Notifications
You must be signed in to change notification settings - Fork 104
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 test cases for apis. #1290
Add test cases for apis. #1290
Conversation
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.
LGTM thanks :)
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.
I left a few nits, but, otherwise lgtm! PTAL and we can 🚢 it
planStatus map[string]PlanStatus | ||
expectedPlanName string | ||
}{ | ||
{"no plan ever run", map[string]PlanStatus{"test": { |
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.
nit: could you please use named fields (e.g. name: "no plan ever run"
) for all test cases? It's getting harder to read for nested structs.
if actualName != tt.expectedPlanName { | ||
t.Errorf("%s: Expected to get plan %s but got plan status of %v", tt.name, tt.expectedPlanName, actual) | ||
} |
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.
simple assertion suffices:
assert.Equal(t, tt.expectedPlanName, actual)
if actual != tt.expectedResult { | ||
t.Errorf("%s: Expected to get plan %v but got %v", tt.name, tt.expectedResult, actual) | ||
} |
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.
same here:
assert.Equal(t, tt. expectedResult, actual)
@harryge00 ping! what is next here? |
Signed-off-by: Ken Sipe <kensipe@gmail.com>
…master and updated code. Signed-off-by: Ken Sipe <kensipe@gmail.com>
Unable to interactive rebase to fix DCO. There is no DCO issue here, all code is modifications and additions to test which are KUDO specific and isn't possible to put us at risk. |
understood. squash and merge with Signed-off-by - this can be done with the Chrome extension. yay for being an admin! |
@harryge00 please at some point confirm you can meet the https://developercertificate.org/ requirements with posting your sign off in this PR, otherwise we will need to re-write your work. thank you! |
sure... shouldn't need a plugin to add a signoff to the merge commit (we just won't get a green build here) |
@kensipe of course you don't, but it's an easy way to just add it in real quick. :) |
What this PR does / why we need it:
Currently,
GetPlanInProgress
andNoPlanEverExecuted
ininstances_types
has no unit tests. Added tests for them.Fixes #