-
Notifications
You must be signed in to change notification settings - Fork 303
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 e2e tests for neg naming and neg crd #1207
Conversation
Hi @swetharepakula. Thanks for your PR. I'm waiting for a kubernetes 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. Instructions 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. |
/ok-to-test |
6662cd4
to
0ef8853
Compare
cmd/e2e-test/neg_test.go
Outdated
@@ -386,3 +386,241 @@ func TestReadinessReflector(t *testing.T) { | |||
} | |||
}) | |||
} | |||
|
|||
func TestEnableNegCRD(t *testing.T) { |
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.
Suggestion: TestNegCRDTransitions
pkg/e2e/helpers.go
Outdated
} | ||
|
||
// CheckDeletedNegCRs verifies that the provided neg list does not have negs that are associated with the provided neg atrributes | ||
func CheckDeletedNegCRs(negs *negv1beta1.ServiceNetworkEndpointGroupList, deletedNegAttrs, negConfigs map[string]string) bool { |
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: s/negs/svcNeg
pkg/e2e/helpers.go
Outdated
} | ||
|
||
// WaitForStandaloneNegDeletion waits for all NEGs associated with a GCLB to be deleted via GC | ||
func WaitForStandaloneNegDeletion(ctx context.Context, c cloud.Cloud, s *Sandbox, expectedDeletedNegCRs, negConfigs map[string]string, zones []string, expectDeletion bool) 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.
negConfigs => map port -> negName
expectedDeleteNegCRs => map port -> name
cmd/e2e-test/neg_test.go
Outdated
}) | ||
} | ||
|
||
func TestNegCRDUserActions(t *testing.T) { |
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.
E2e test is quite heavy. I would recommend not adding e2e test for negative cases.
Unless, it is a very important negative case.
Let us discuss if this is worth keeping
cmd/e2e-test/neg_test.go
Outdated
desc string | ||
annotations annotations.NegAnnotation | ||
expectedNegAttrs map[string]string | ||
gcNegAttrs map[string]string |
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.
might be worth adding another parameter: replicas?
I think WaitForNegs
should already check the number of endpoints in the NEGs.
pkg/e2e/helpers.go
Outdated
@@ -539,6 +545,41 @@ func CheckNegStatus(svc *v1.Service, expectSvcPors []string) (annotations.NegSta | |||
return negStatus, nil | |||
} | |||
|
|||
// CheckCustomNegNameStatus checks if the NEG Status annotation is present and in the expected state | |||
func CheckCustomNegNameStatus(svc *v1.Service, expectedNegAttrs map[string]string) (annotations.NegStatus, 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.
add a comment about expectedNegAttrs
parameter
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.
CheckNameInNegStatus?
pkg/e2e/helpers.go
Outdated
return nil | ||
} | ||
|
||
// WaitForStandaloneNegDeletion waits for all NEGs associated with a GCLB to be deleted via GC |
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.
// WaitForStandaloneNegDeletion waits for standalone NEGs and corresponding CRDs are deleted via GC.
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.
add comments about expectedDelteNegsCRs, negConfigs
consider:
- pass negConfigs and zones together as pastNegStatus.
- pass the NEG name which expected to be deleted. So that making the function simpler only validate if one NEG and CRD has been delete .
0ef8853
to
36d7216
Compare
36d7216
to
ed31781
Compare
ed31781
to
1bae87d
Compare
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
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: freehan, swetharepakula The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
No description provided.