Move kubectl e2e tests to their own directory and prefix the test names with [sig-cli]

pull/6/head
Phillip Wittrock 2017-07-10 10:03:40 -07:00
parent 9e22353929
commit 2b5b4d26ae
9 changed files with 108 additions and 19 deletions

View File

@ -49,6 +49,7 @@ package_group(
packages = [ packages = [
"//test/e2e", "//test/e2e",
"//test/e2e/framework", "//test/e2e/framework",
"//test/e2e/kubectl",
"//test/e2e/workload", "//test/e2e/workload",
"//test/integration/etcd", "//test/integration/etcd",
"//test/integration/framework", "//test/integration/framework",

View File

@ -72,7 +72,6 @@ go_library(
"ingress.go", "ingress.go",
"kibana_logging.go", "kibana_logging.go",
"kube_proxy.go", "kube_proxy.go",
"kubectl.go",
"kubelet.go", "kubelet.go",
"kubelet_perf.go", "kubelet_perf.go",
"limit_range.go", "limit_range.go",
@ -89,9 +88,7 @@ go_library(
"pod_gc.go", "pod_gc.go",
"podpreset.go", "podpreset.go",
"pods.go", "pods.go",
"portforward.go",
"pre_stop.go", "pre_stop.go",
"proxy.go",
"reboot.go", "reboot.go",
"resize_nodes.go", "resize_nodes.go",
"resource_quota.go", "resource_quota.go",
@ -111,7 +108,6 @@ go_library(
"//pkg/api:go_default_library", "//pkg/api:go_default_library",
"//pkg/api/v1/pod:go_default_library", "//pkg/api/v1/pod:go_default_library",
"//pkg/api/v1/service:go_default_library", "//pkg/api/v1/service:go_default_library",
"//pkg/apis/batch/v2alpha1:go_default_library",
"//pkg/apis/networking:go_default_library", "//pkg/apis/networking:go_default_library",
"//pkg/client/clientset_generated/clientset:go_default_library", "//pkg/client/clientset_generated/clientset:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/certificates/v1beta1:go_default_library", "//pkg/client/clientset_generated/clientset/typed/certificates/v1beta1:go_default_library",
@ -122,13 +118,11 @@ go_library(
"//pkg/controller:go_default_library", "//pkg/controller:go_default_library",
"//pkg/controller/endpoint:go_default_library", "//pkg/controller/endpoint:go_default_library",
"//pkg/controller/node:go_default_library", "//pkg/controller/node:go_default_library",
"//pkg/kubectl/cmd/util:go_default_library",
"//pkg/kubelet/apis:go_default_library", "//pkg/kubelet/apis:go_default_library",
"//pkg/kubelet/apis/stats/v1alpha1:go_default_library", "//pkg/kubelet/apis/stats/v1alpha1:go_default_library",
"//pkg/kubelet/pod:go_default_library", "//pkg/kubelet/pod:go_default_library",
"//pkg/master/ports:go_default_library", "//pkg/master/ports:go_default_library",
"//pkg/quota/evaluator/core:go_default_library", "//pkg/quota/evaluator/core:go_default_library",
"//pkg/util/exec:go_default_library",
"//pkg/util/logs:go_default_library", "//pkg/util/logs:go_default_library",
"//pkg/util/version:go_default_library", "//pkg/util/version:go_default_library",
"//plugin/pkg/admission/serviceaccount:go_default_library", "//plugin/pkg/admission/serviceaccount:go_default_library",
@ -139,15 +133,12 @@ go_library(
"//test/e2e/generated:go_default_library", "//test/e2e/generated:go_default_library",
"//test/e2e/manifest:go_default_library", "//test/e2e/manifest:go_default_library",
"//test/e2e/metrics:go_default_library", "//test/e2e/metrics:go_default_library",
"//test/e2e/scheduling:go_default_library",
"//test/e2e/upgrades:go_default_library", "//test/e2e/upgrades:go_default_library",
"//test/e2e/workload:go_default_library", "//test/e2e/workload:go_default_library",
"//test/e2e_federation:go_default_library", "//test/e2e_federation:go_default_library",
"//test/images/net/nat:go_default_library", "//test/images/net/nat:go_default_library",
"//test/utils:go_default_library", "//test/utils:go_default_library",
"//test/utils/junit:go_default_library", "//test/utils/junit:go_default_library",
"//vendor/github.com/elazarl/goproxy:go_default_library",
"//vendor/github.com/ghodss/yaml:go_default_library",
"//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/golang/glog:go_default_library",
"//vendor/github.com/google/cadvisor/info/v1:go_default_library", "//vendor/github.com/google/cadvisor/info/v1:go_default_library",
"//vendor/github.com/influxdata/influxdb/client/v2:go_default_library", "//vendor/github.com/influxdata/influxdb/client/v2:go_default_library",
@ -156,7 +147,6 @@ go_library(
"//vendor/github.com/onsi/ginkgo/reporters:go_default_library", "//vendor/github.com/onsi/ginkgo/reporters:go_default_library",
"//vendor/github.com/onsi/gomega:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library",
"//vendor/golang.org/x/crypto/ssh:go_default_library", "//vendor/golang.org/x/crypto/ssh:go_default_library",
"//vendor/golang.org/x/net/websocket:go_default_library",
"//vendor/golang.org/x/oauth2/google:go_default_library", "//vendor/golang.org/x/oauth2/google:go_default_library",
"//vendor/google.golang.org/api/monitoring/v3:go_default_library", "//vendor/google.golang.org/api/monitoring/v3:go_default_library",
"//vendor/k8s.io/api/batch/v1:go_default_library", "//vendor/k8s.io/api/batch/v1:go_default_library",
@ -179,7 +169,6 @@ go_library(
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/intstr:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/intstr:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/uuid:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/uuid:go_default_library",
@ -187,7 +176,6 @@ go_library(
"//vendor/k8s.io/apimachinery/pkg/util/yaml:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/yaml:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
"//vendor/k8s.io/apiserver/pkg/authentication/serviceaccount:go_default_library", "//vendor/k8s.io/apiserver/pkg/authentication/serviceaccount:go_default_library",
"//vendor/k8s.io/apiserver/pkg/registry/generic/registry:go_default_library",
"//vendor/k8s.io/client-go/discovery:go_default_library", "//vendor/k8s.io/client-go/discovery:go_default_library",
"//vendor/k8s.io/client-go/kubernetes:go_default_library", "//vendor/k8s.io/client-go/kubernetes:go_default_library",
"//vendor/k8s.io/client-go/rest:go_default_library", "//vendor/k8s.io/client-go/rest:go_default_library",
@ -225,6 +213,7 @@ filegroup(
"//test/e2e/extension:all-srcs", "//test/e2e/extension:all-srcs",
"//test/e2e/framework:all-srcs", "//test/e2e/framework:all-srcs",
"//test/e2e/generated:all-srcs", "//test/e2e/generated:all-srcs",
"//test/e2e/kubectl:all-srcs",
"//test/e2e/manifest:all-srcs", "//test/e2e/manifest:all-srcs",
"//test/e2e/metrics:all-srcs", "//test/e2e/metrics:all-srcs",
"//test/e2e/perftype:all-srcs", "//test/e2e/perftype:all-srcs",

View File

@ -52,6 +52,9 @@ const (
// images within this time we simply log their output and carry on // images within this time we simply log their output and carry on
// with the tests. // with the tests.
imagePrePullingTimeout = 5 * time.Minute imagePrePullingTimeout = 5 * time.Minute
// TODO: Delete this once all the tests that depend upon it are moved out of test/e2e and into subdirs
podName = "pfpod"
) )
var ( var (

63
test/e2e/kubectl/BUILD Normal file
View File

@ -0,0 +1,63 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"framework.go",
"kubectl.go",
"portforward.go",
"proxy.go",
],
tags = ["automanaged"],
deps = [
"//pkg/api:go_default_library",
"//pkg/apis/batch/v2alpha1:go_default_library",
"//pkg/client/clientset_generated/clientset:go_default_library",
"//pkg/controller:go_default_library",
"//pkg/kubectl/cmd/util:go_default_library",
"//pkg/util/exec:go_default_library",
"//pkg/util/version:go_default_library",
"//test/e2e/framework:go_default_library",
"//test/e2e/generated:go_default_library",
"//test/e2e/scheduling:go_default_library",
"//test/utils:go_default_library",
"//vendor/github.com/elazarl/goproxy:go_default_library",
"//vendor/github.com/ghodss/yaml:go_default_library",
"//vendor/github.com/onsi/ginkgo:go_default_library",
"//vendor/github.com/onsi/gomega:go_default_library",
"//vendor/golang.org/x/net/websocket:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
"//vendor/k8s.io/api/rbac/v1beta1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/intstr:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/uuid:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library",
"//vendor/k8s.io/apiserver/pkg/authentication/serviceaccount:go_default_library",
"//vendor/k8s.io/apiserver/pkg/registry/generic/registry:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)

4
test/e2e/kubectl/OWNERS Normal file
View File

@ -0,0 +1,4 @@
approvers:
- sig-cli-maintainers
reviewers:
- sig-cli

View File

@ -0,0 +1,23 @@
/*
Copyright 2015 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package kubectl
import "k8s.io/kubernetes/test/e2e/framework"
func kubectlDescribe(text string, body func()) bool {
return framework.KubeDescribe("[sig-cli] "+text, body)
}

View File

@ -14,7 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package e2e // OWNER = sig/cli
package kubectl
import ( import (
"bytes" "bytes"
@ -184,7 +186,7 @@ func runKubectlRetryOrDie(args ...string) string {
} }
// duplicated setup to avoid polluting "normal" clients with alpha features which confuses the generated clients // duplicated setup to avoid polluting "normal" clients with alpha features which confuses the generated clients
var _ = framework.KubeDescribe("Kubectl alpha client", func() { var _ = kubectlDescribe("Kubectl alpha client", func() {
defer GinkgoRecover() defer GinkgoRecover()
f := framework.NewDefaultFramework("kubectl") f := framework.NewDefaultFramework("kubectl")
@ -273,7 +275,7 @@ var _ = framework.KubeDescribe("Kubectl alpha client", func() {
}) })
}) })
var _ = framework.KubeDescribe("Kubectl client", func() { var _ = kubectlDescribe("Kubectl client", func() {
defer GinkgoRecover() defer GinkgoRecover()
f := framework.NewDefaultFramework("kubectl") f := framework.NewDefaultFramework("kubectl")

View File

@ -14,7 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package e2e // OWNER = sig/cli
package kubectl
import ( import (
"bytes" "bytes"
@ -469,7 +471,7 @@ func doTestOverWebSockets(bindAddress string, f *framework.Framework) {
verifyLogMessage(logOutput, "^Received expected client data$") verifyLogMessage(logOutput, "^Received expected client data$")
} }
var _ = framework.KubeDescribe("Port forwarding", func() { var _ = kubectlDescribe("Kubectl Port forwarding", func() {
f := framework.NewDefaultFramework("port-forwarding") f := framework.NewDefaultFramework("port-forwarding")
framework.KubeDescribe("With a server listening on 0.0.0.0", func() { framework.KubeDescribe("With a server listening on 0.0.0.0", func() {

View File

@ -14,7 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package e2e // OWNER = sig/cli
package kubectl
import ( import (
"fmt" "fmt"
@ -49,7 +51,7 @@ const (
proxyHTTPCallTimeout = 30 * time.Second proxyHTTPCallTimeout = 30 * time.Second
) )
var _ = framework.KubeDescribe("Proxy", func() { var _ = kubectlDescribe("Kubectl Proxy", func() {
version := api.Registry.GroupOrDie(v1.GroupName).GroupVersion.Version version := api.Registry.GroupOrDie(v1.GroupName).GroupVersion.Version
Context("version "+version, func() { Context("version "+version, func() {
options := framework.FrameworkOptions{ options := framework.FrameworkOptions{