-
Notifications
You must be signed in to change notification settings - Fork 850
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
Unit Tests for podchaos #337
Conversation
Thanks for your contribution. If your PR get merged, you will be rewarded 50 points. |
Codecov Report
@@ Coverage Diff @@
## master #337 +/- ##
=======================================
Coverage 57.91% 57.91%
=======================================
Files 58 58
Lines 3236 3236
=======================================
Hits 1874 1874
Misses 1218 1218
Partials 144 144 Continue to review full report at Codecov.
|
@fewdan PTAL |
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.
rest LGTM
// It returns all pods that match the configured label, annotation and namespace selectors. | ||
// If pods are specifically specified by `selector.Pods`, it just returns the selector.Pods. | ||
func SelectPods(ctx context.Context, c client.Client, selector v1alpha1.SelectorSpec) ([]v1.Pod, error) { | ||
func selectPods(ctx context.Context, c client.Client, selector v1alpha1.SelectorSpec) ([]v1.Pod, error) { |
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.
'podchaos/podkill/types' and 'podchaos/containerkill/types' all reference this function. So the first letter should be capitalized.
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.
As they all share the logic of the existing SelectAndFilterPods
, I've replaced the occurrence in 'podchaos/podkill/types' and 'podchaos/containerkill/types' to SelectAndFilterPods
, that's why I changed those two function to local in f67765a.
// FilterPodsByMode filters pods by mode from pod list | ||
func FilterPodsByMode(pods []v1.Pod, mode v1alpha1.PodMode, value string) ([]v1.Pod, error) { | ||
// filterPodsByMode filters pods by mode from pod list | ||
func filterPodsByMode(pods []v1.Pod, mode v1alpha1.PodMode, value string) ([]v1.Pod, error) { |
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.
ditto
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.
Rest LGTM
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
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
@cwen0 PTAL too |
/merge |
/run-all-tests |
UCP #264
What problem does this PR solve?
#264
What is changed and how does it work?
Check List
Tests
Code changes
Side effects
Related changes
Does this PR introduce a user-facing change?: