-
Notifications
You must be signed in to change notification settings - Fork 64
K8SPG-613: add unit-test #1204
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
K8SPG-613: add unit-test #1204
Conversation
}) | ||
}) | ||
|
||
crunchyCr := v1beta1.PostgresCluster{} |
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.
Why this is defined outside the It("should get PostgresCluster", func() {
? From what I can see it is not used anywhere else.
Expect(initContainer.Resources).To(Equal(corev1.ResourceRequirements{})) | ||
Expect(initContainer.SecurityContext).To(Equal(&corev1.SecurityContext{ | ||
Capabilities: &corev1.Capabilities{ | ||
Drop: []corev1.Capability{ |
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.
Casting to corev1.Capability
can be omitted.
Expect(len(stsList.Items)).To(Equal(3)) | ||
}) | ||
It("should have updated init container", func() { | ||
Expect(len(stsList.Items)).To(Equal(3)) |
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.
We repeat the same assertion 3 lines above, is this needed? I think we can remove this here.
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.
we do the same in some It
's below
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.
commit: ae5e927 |
https://perconadev.atlassian.net/browse/K8SPG-613
CHANGE DESCRIPTION
Problem:
Short explanation of the problem.
Cause:
Short explanation of the root cause of the issue if applicable.
Solution:
Short explanation of the solution we are providing with this PR.
CHECKLIST
Jira
Needs Doc
) and QA (Needs QA
)?Tests
Config/Logging/Testability