-
Notifications
You must be signed in to change notification settings - Fork 35
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
E2E testcases for role,clusterrole,rolebinding,clusterrolebinding,secret,service,storageclass resources for backup and restore feature #116
Conversation
Please add test scripts running snapshot |
test/e2e/deployment/rbac.go
Outdated
|
||
//testcase for E2E deployment backup and restore | ||
var _ = Describe("rbacBackup", Label("rbac"), func() { | ||
Describe("rbacE2ETest", func() { |
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.
IMO, Describe
section can be removed
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.
done
test/e2e/deployment/rbac.go
Outdated
"github.com/soda-cdm/kahu/controllers/app/options" | ||
k8s "github.com/soda-cdm/kahu/test/e2e/util/k8s" | ||
kahu "github.com/soda-cdm/kahu/test/e2e/util/kahu" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
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.
Please maintain logical grouping of import statements
test/e2e/deployment/rbac.go
Outdated
|
||
optManager, err := options.NewOptionsManager() | ||
Expect(err).To(BeNil()) | ||
if err != nil { |
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.
IMO, 'err' is already checked with asserts.
Please handle other places as well
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.
done
test/e2e/deployment/rbac.go
Outdated
//Create rbac to test | ||
ns := "default" | ||
ctx := context.TODO() | ||
UUIDgen, _ := uuid.NewRandom() |
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.
IMO, Its better add assets for err 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.
done
test/e2e/deployment/rbac.go
Outdated
kahuClient, err := f.KahuClient() | ||
|
||
//Create rbac to test | ||
ns := "default" |
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.
Please initialise namespace constants/variable in setup
and cleanup in teardown
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.
done
test/e2e/deployment/rbac.go
Outdated
_, err = kahuClient.KahuV1beta1().Backups().Create(ctx, backup, opts) | ||
Expect(err).To(BeNil()) | ||
log.Infof("backup of rbac is done\n") | ||
time.Sleep(40 * time.Second) |
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 believe, Wait/poll for backup to finish is little better than sleep
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.
done
test/e2e/deployment/rbac.go
Outdated
Expect(err).To(BeNil()) | ||
|
||
err = k8s.DeletePod(ctx, kubeClient, nsRestore, podName) | ||
Expect(err).To(BeNil()) |
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.
IMO, If all operation are done in a separate namespace. Deleting namespace will handle deleting all other resources
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.
done
Signed-off-by: vineela1999 <vineelapachipulusu@gmail.com>
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
What type of PR is this?
kind new feature
What this PR does / why we need it:
This PR contains E2E testcases for role,clusterrole,rolebinding,clusterrolebinding,secret,service,storageclass resources for backup and restore feature using ginkgo framework
Which issue(s) this PR fixes:
Fixes #
Test Report Added?:
kind TESTED
Test Report:
Special notes for your reviewer: