Skip to content
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

Enable e2e testing on EKS, parallelism, and make optional EFS creation/driver deployment #160

Merged
merged 4 commits into from
May 28, 2020

Conversation

wongma7
Copy link
Contributor

@wongma7 wongma7 commented May 9, 2020

Is this a bug fix or adding new feature? fix

What is this PR about? / Why do we need it? When I tried to run the tests on EFS in parallel I ran into a couple of issues. This is the sum of fixes I needed to make to get the tests to pass.

EFS creation queries kops-specific tags, so change cloud.go a bit to also check for EKS-style tags.

Since multiple tests can be run if I run by doing ginkgo -p, I found it's best to move EFS creation/driver deployment to SynchronizedBefore/AfterSuite. Moreover, I made it optional since outside of the CI environment there may be an existing EFS/driver that the test can use.

What testing is done? I ran the tests against my EKS cluster.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 9, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wongma7

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 9, 2020
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 9, 2020
Copy link
Contributor

@jqmichael jqmichael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Left some trivial comments. Feel free to ignore.

Comment on lines +65 to +66
switch t := err.(type) {
case *efs.FileSystemAlreadyExists:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you help me understand what does case *efs.FileSystemAlreadyExists do?

type FileSystemAlreadyExists struct {
	_            struct{}                  `type:"structure"`
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	// ErrorCode is a required field
	ErrorCode *string `min:"1" type:"string" required:"true"`

	// FileSystemId is a required field
	FileSystemId *string `type:"string" required:"true"`

	Message_ *string `locationName:"Message" type:"string"`
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error() is an an implementation to the pointer receiver of FileSystemAlreadyExists.

func (s *FileSystemAlreadyExists) Error() string {

Comment on lines +146 to +153
groupId, err := c.getKopsSecurityGroup(clusterName)
if err != nil {
fmt.Printf("error getting kops node security group: %v\n", err)
} else {
return groupId, nil
}

groupid, err := c.getEksSecurityGroup(clusterName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider running them in parallel.

Comment on lines +223 to +227
for _, sg := range response.SecurityGroups {
if strings.Contains(strings.ToLower(*sg.GroupName), "node") {
groupId = aws.StringValue(sg.GroupId)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

break

Comment on lines +102 to +103
var _ = ginkgo.SynchronizedBeforeSuite(func() []byte {
// Validate parameters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my notes:

SynchronizedBeforeSuite blocks are primarily meant to solve the problem of setting up singleton external resources shared across nodes when running tests in parallel. For example, say you have a shared database that you can only start one instance of that must be used in your tests. When running in parallel, only one node should set up the database and all other nodes should wait until that node is done before running.

SynchronizedBeforeSuite accomplishes this by taking two function arguments. The first is only run on parallel node #1. The second is run on all nodes, but only after the first function completes successfully. Ginkgo also makes it possible to send data from the first function (on Node 1) to the second function (on all the other nodes).

https://godoc.org/github.com/onsi/ginkgo#SynchronizedBeforeSuite

@k8s-ci-robot
Copy link
Contributor

@jqmichael: changing LGTM is restricted to collaborators

In response to this:

/lgtm

Left some trivial comments. Feel free to ignore.

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.

@nckturner
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 28, 2020
@k8s-ci-robot k8s-ci-robot merged commit 6e73fac into kubernetes-sigs:master May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants