Skip to content
Permalink
Browse files

Merge pull request #99374 from wojtek-t/cleanup_describe_3

Cleanup tests/e2e/common directory - part 1
  • Loading branch information
k8s-ci-robot committed Feb 25, 2021
2 parents 27c89b9 + 7b2458a commit 2b930d99bdd88c70ee3c4ff54d0cb7431075fe8c

Large diffs are not rendered by default.

@@ -8,35 +8,23 @@ load(
go_library(
name = "go_default_library",
srcs = [
"configmap.go",
"configmap_volume.go",
"container.go",
"container_probe.go",
"docker_containers.go",
"downward_api.go",
"downwardapi_volume.go",
"empty_dir.go",
"downwardapi.go",
"expansion.go",
"framework.go",
"host_path.go",
"imports.go",
"init_container.go",
"kubelet.go",
"kubelet_etc_hosts.go",
"lease.go",
"lifecycle_hook.go",
"networking.go",
"node_lease.go",
"pods.go",
"podtemplates.go",
"privileged.go",
"projected_combined.go",
"projected_configmap.go",
"projected_downwardapi.go",
"projected_secret.go",
"runtime.go",
"runtimeclass.go",
"secrets.go",
"secrets_volume.go",
"security_context.go",
"sysctl.go",
"util.go",
@@ -46,14 +34,11 @@ go_library(
deps = [
"//pkg/api/v1/pod:go_default_library",
"//pkg/client/conditions:go_default_library",
"//pkg/features:go_default_library",
"//pkg/kubelet:go_default_library",
"//pkg/kubelet/events:go_default_library",
"//pkg/kubelet/images:go_default_library",
"//pkg/kubelet/runtimeclass/testing:go_default_library",
"//staging/src/k8s.io/api/coordination/v1:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/api/node/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
@@ -70,11 +55,13 @@ go_library(
"//staging/src/k8s.io/apimachinery/pkg/util/uuid:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/wait:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",
"//staging/src/k8s.io/client-go/dynamic:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
"//staging/src/k8s.io/client-go/tools/cache:go_default_library",
"//staging/src/k8s.io/client-go/tools/watch:go_default_library",
"//test/e2e/common/network:go_default_library",
"//test/e2e/common/node:go_default_library",
"//test/e2e/common/storage:go_default_library",
"//test/e2e/framework:go_default_library",
"//test/e2e/framework/events:go_default_library",
"//test/e2e/framework/network:go_default_library",
@@ -104,6 +91,11 @@ filegroup(

filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
srcs = [
":package-srcs",
"//test/e2e/common/network:all-srcs",
"//test/e2e/common/node:all-srcs",
"//test/e2e/common/storage:all-srcs",
],
tags = ["automanaged"],
)
File renamed without changes.
@@ -0,0 +1,24 @@
/*
Copyright 2021 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 common

import (
// ensure these packages are scanned by ginkgo for e2e tests
_ "k8s.io/kubernetes/test/e2e/common/network"
_ "k8s.io/kubernetes/test/e2e/common/node"
_ "k8s.io/kubernetes/test/e2e/common/storage"
)
@@ -0,0 +1,32 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
srcs = [
"framework.go",
"networking.go",
],
importpath = "k8s.io/kubernetes/test/e2e/common/network",
visibility = ["//visibility:public"],
deps = [
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//test/e2e/framework:go_default_library",
"//test/e2e/framework/network:go_default_library",
"//vendor/github.com/onsi/ginkgo: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"],
)
@@ -0,0 +1,4 @@
# See the OWNERS docs at https://go.k8s.io/owners

labels:
- sig/network
@@ -0,0 +1,24 @@
/*
Copyright 2021 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 network

import "k8s.io/kubernetes/test/e2e/framework"

// SIGDescribe annotates the test with the SIG label.
func SIGDescribe(text string, body func()) bool {
return framework.KubeDescribe("[sig-network] "+text, body)
}
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package common
package network

import (
"github.com/onsi/ginkgo"
@@ -24,7 +24,7 @@ import (
e2enetwork "k8s.io/kubernetes/test/e2e/framework/network"
)

var _ = SIGNetworkDescribe("Networking", func() {
var _ = SIGDescribe("Networking", func() {
f := framework.NewDefaultFramework("pod-network-test")

ginkgo.Describe("Granular Checks: Pods", func() {
@@ -0,0 +1,46 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
srcs = [
"configmap.go",
"framework.go",
"podtemplates.go",
"runtimeclass.go",
],
importpath = "k8s.io/kubernetes/test/e2e/common/node",
visibility = ["//visibility:public"],
deps = [
"//pkg/kubelet/events:go_default_library",
"//pkg/kubelet/runtimeclass/testing:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/api/node/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/fields:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/uuid:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/wait:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library",
"//test/e2e/framework:go_default_library",
"//test/e2e/framework/events:go_default_library",
"//test/e2e/framework/node:go_default_library",
"//test/e2e/framework/pod:go_default_library",
"//test/utils/image:go_default_library",
"//vendor/github.com/onsi/ginkgo: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"],
)
@@ -0,0 +1,4 @@
# See the OWNERS docs at https://go.k8s.io/owners

labels:
- sig/node
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package common
package node

import (
"context"
@@ -31,7 +31,7 @@ import (
"github.com/onsi/ginkgo"
)

var _ = SIGNodeDescribe("ConfigMap", func() {
var _ = SIGDescribe("ConfigMap", func() {
f := framework.NewDefaultFramework("configmap")

/*
@@ -238,6 +238,21 @@ var _ = SIGNodeDescribe("ConfigMap", func() {
})
})

func newConfigMap(f *framework.Framework, name string) *v1.ConfigMap {
return &v1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{
Namespace: f.Namespace.Name,
Name: name,
},
Data: map[string]string{
"data-1": "value-1",
"data-2": "value-2",
"data-3": "value-3",
},
}
}

// TODO: Unify with newConfigMap
func newEnvFromConfigMap(f *framework.Framework, name string) *v1.ConfigMap {
return &v1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{
@@ -0,0 +1,24 @@
/*
Copyright 2021 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 node

import "k8s.io/kubernetes/test/e2e/framework"

// SIGDescribe annotates the test with the SIG label.
func SIGDescribe(text string, body func()) bool {
return framework.KubeDescribe("[sig-node] "+text, body)
}
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package common
package node

import (
"context"
@@ -38,7 +38,7 @@ const (
podTemplateRetryTimeout = 1 * time.Minute
)

var _ = SIGNodeDescribe("PodTemplates", func() {
var _ = SIGDescribe("PodTemplates", func() {
f := framework.NewDefaultFramework("podtemplate")
/*
Release: v1.19
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package common
package node

import (
"context"
@@ -39,7 +39,7 @@ import (
"github.com/onsi/ginkgo"
)

var _ = SIGNodeDescribe("RuntimeClass", func() {
var _ = SIGDescribe("RuntimeClass", func() {
f := framework.NewDefaultFramework("runtimeclass")

ginkgo.It("should reject a Pod requesting a non-existent RuntimeClass [NodeFeature:RuntimeHandler]", func() {
@@ -233,6 +233,21 @@ var _ = ginkgo.Describe("[sig-api-machinery] Secrets", func() {
})
})

func secretForTest(namespace, name string) *v1.Secret {
return &v1.Secret{
ObjectMeta: metav1.ObjectMeta{
Namespace: namespace,
Name: name,
},
Data: map[string][]byte{
"data-1": []byte("value-1\n"),
"data-2": []byte("value-2\n"),
"data-3": []byte("value-3\n"),
},
}
}

// TODO: Unify with secretForTest.
func newEnvFromSecret(namespace, name string) *v1.Secret {
return &v1.Secret{
ObjectMeta: metav1.ObjectMeta{

0 comments on commit 2b930d9

Please sign in to comment.