-
Notifications
You must be signed in to change notification settings - Fork 39.7k
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
Refactor and clean up e2e framework utils, this patch handles test/e2e/framework/psp_util.go file #77534
Merged
Merged
Refactor and clean up e2e framework utils, this patch handles test/e2e/framework/psp_util.go file #77534
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library") | ||
|
||
go_library( | ||
name = "go_default_library", | ||
srcs = ["psp.go"], | ||
importpath = "k8s.io/kubernetes/test/e2e/framework/psp", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//pkg/security/podsecuritypolicy/seccomp:go_default_library", | ||
"//staging/src/k8s.io/api/core/v1:go_default_library", | ||
"//staging/src/k8s.io/api/policy/v1beta1:go_default_library", | ||
"//staging/src/k8s.io/api/rbac/v1:go_default_library", | ||
"//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library", | ||
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", | ||
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", | ||
"//staging/src/k8s.io/apiserver/pkg/authentication/serviceaccount:go_default_library", | ||
"//staging/src/k8s.io/client-go/kubernetes:go_default_library", | ||
"//test/e2e/framework/auth:go_default_library", | ||
"//test/e2e/framework/log:go_default_library", | ||
"//vendor/github.com/onsi/ginkgo:go_default_library", | ||
"//vendor/github.com/onsi/gomega:go_default_library", | ||
], | ||
) | ||
|
||
filegroup( | ||
name = "package-srcs", | ||
srcs = glob(["**"]), | ||
tags = ["automanaged"], | ||
visibility = ["//visibility:private"], | ||
) | ||
|
||
filegroup( | ||
name = "all-srcs", | ||
srcs = [":package-srcs"], | ||
tags = ["automanaged"], | ||
visibility = ["//visibility:public"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
the
ExpectNoError
from the framework callsgomega.ExpectWithOffset(1, err)
notgomega.ExpectWithOffset(2, err)
, correct? If so, we should change this.This patch changes the current behavior. Which is not wrong but we should add it in a separate PR and only focus on refactoring for this on. This way we can revert if something starts failing in CI.
/lgtm cancel
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.
@alejandrox1 Do you mean we should change
gomega.ExpectWithOffset(2, err).NotTo(gomega.HaveOccurred(), explain...)
togomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), explain...)
? But I believe the original definition should begomega.ExpectWithOffset(2, err).NotTo(gomega.HaveOccurred(), explain...)
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.
Sorry, you are completely right!
Given https://github.com/kubernetes/kubernetes/blob/master/test/e2e/framework/util.go#L1321
a
framework.NoExpectError
is equivalent togomega.ExpectWithOffset(2, err).NotTo(gomega.HaveOccurred(), explain...)
./lgtm
/hold cancel