From bf984efcc78d5de00eb4b92359b2654e20e93e33 Mon Sep 17 00:00:00 2001 From: alejandrox1 Date: Thu, 9 Apr 2020 20:26:01 -0400 Subject: [PATCH] Moved e2e/manifests to e2e test framework The functionality included in the e2e/manifests is useful for writing e2e tests and will be a good addition to the test framework as a sub-package. Signed-off-by: alejandrox1 --- test/e2e/BUILD | 3 +-- test/e2e/e2e.go | 4 ++-- test/e2e/framework/BUILD | 1 + test/e2e/{ => framework}/manifest/BUILD | 2 +- test/e2e/{ => framework}/manifest/manifest.go | 0 test/e2e/framework/statefulset/BUILD | 2 +- test/e2e/framework/statefulset/rest.go | 6 +++--- 7 files changed, 9 insertions(+), 9 deletions(-) rename test/e2e/{ => framework}/manifest/BUILD (93%) rename test/e2e/{ => framework}/manifest/manifest.go (100%) diff --git a/test/e2e/BUILD b/test/e2e/BUILD index 028f47eac04..228e12dd5df 100644 --- a/test/e2e/BUILD +++ b/test/e2e/BUILD @@ -75,6 +75,7 @@ go_library( "//test/e2e/framework:go_default_library", "//test/e2e/framework/auth:go_default_library", "//test/e2e/framework/kubectl:go_default_library", + "//test/e2e/framework/manifest:go_default_library", "//test/e2e/framework/metrics:go_default_library", "//test/e2e/framework/node:go_default_library", "//test/e2e/framework/pod:go_default_library", @@ -86,7 +87,6 @@ go_library( "//test/e2e/framework/providers/vsphere:go_default_library", "//test/e2e/framework/skipper:go_default_library", "//test/e2e/framework/testfiles:go_default_library", - "//test/e2e/manifest:go_default_library", "//test/e2e/reporters:go_default_library", "//test/utils:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", @@ -123,7 +123,6 @@ filegroup( "//test/e2e/instrumentation:all-srcs", "//test/e2e/kubectl:all-srcs", "//test/e2e/lifecycle:all-srcs", - "//test/e2e/manifest:all-srcs", "//test/e2e/network:all-srcs", "//test/e2e/node:all-srcs", "//test/e2e/perftype:all-srcs", diff --git a/test/e2e/e2e.go b/test/e2e/e2e.go index 6a60d773bc0..d952b154d9c 100644 --- a/test/e2e/e2e.go +++ b/test/e2e/e2e.go @@ -45,9 +45,9 @@ import ( commontest "k8s.io/kubernetes/test/e2e/common" "k8s.io/kubernetes/test/e2e/framework" e2ekubectl "k8s.io/kubernetes/test/e2e/framework/kubectl" + e2emanifest "k8s.io/kubernetes/test/e2e/framework/manifest" e2enode "k8s.io/kubernetes/test/e2e/framework/node" e2epod "k8s.io/kubernetes/test/e2e/framework/pod" - "k8s.io/kubernetes/test/e2e/manifest" e2ereporters "k8s.io/kubernetes/test/e2e/reporters" testutils "k8s.io/kubernetes/test/utils" utilnet "k8s.io/utils/net" @@ -135,7 +135,7 @@ func RunE2ETests(t *testing.T) { func runKubernetesServiceTestContainer(c clientset.Interface, ns string) { path := "test/images/clusterapi-tester/pod.yaml" framework.Logf("Parsing pod from %v", path) - p, err := manifest.PodFromManifest(path) + p, err := e2emanifest.PodFromManifest(path) if err != nil { framework.Logf("Failed to parse clusterapi-tester from manifest %v: %v", path, err) return diff --git a/test/e2e/framework/BUILD b/test/e2e/framework/BUILD index 80cc4434d94..370daec5a3c 100644 --- a/test/e2e/framework/BUILD +++ b/test/e2e/framework/BUILD @@ -116,6 +116,7 @@ filegroup( "//test/e2e/framework/kubelet:all-srcs", "//test/e2e/framework/kubesystem:all-srcs", "//test/e2e/framework/log:all-srcs", + "//test/e2e/framework/manifest:all-srcs", "//test/e2e/framework/metrics:all-srcs", "//test/e2e/framework/network:all-srcs", "//test/e2e/framework/node:all-srcs", diff --git a/test/e2e/manifest/BUILD b/test/e2e/framework/manifest/BUILD similarity index 93% rename from test/e2e/manifest/BUILD rename to test/e2e/framework/manifest/BUILD index 1d782ce8570..884d07c675b 100644 --- a/test/e2e/manifest/BUILD +++ b/test/e2e/framework/manifest/BUILD @@ -8,7 +8,7 @@ load( go_library( name = "go_default_library", srcs = ["manifest.go"], - importpath = "k8s.io/kubernetes/test/e2e/manifest", + importpath = "k8s.io/kubernetes/test/e2e/framework/manifest", deps = [ "//staging/src/k8s.io/api/apps/v1:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library", diff --git a/test/e2e/manifest/manifest.go b/test/e2e/framework/manifest/manifest.go similarity index 100% rename from test/e2e/manifest/manifest.go rename to test/e2e/framework/manifest/manifest.go diff --git a/test/e2e/framework/statefulset/BUILD b/test/e2e/framework/statefulset/BUILD index 9cb37588bee..2be6126dddf 100644 --- a/test/e2e/framework/statefulset/BUILD +++ b/test/e2e/framework/statefulset/BUILD @@ -22,7 +22,7 @@ go_library( "//staging/src/k8s.io/client-go/kubernetes:go_default_library", "//staging/src/k8s.io/kubectl/pkg/util/podutils:go_default_library", "//test/e2e/framework:go_default_library", - "//test/e2e/manifest:go_default_library", + "//test/e2e/framework/manifest:go_default_library", "//test/utils/image:go_default_library", ], ) diff --git a/test/e2e/framework/statefulset/rest.go b/test/e2e/framework/statefulset/rest.go index a7cb2da78dc..d6356db7d4b 100644 --- a/test/e2e/framework/statefulset/rest.go +++ b/test/e2e/framework/statefulset/rest.go @@ -33,7 +33,7 @@ import ( clientset "k8s.io/client-go/kubernetes" "k8s.io/kubectl/pkg/util/podutils" "k8s.io/kubernetes/test/e2e/framework" - "k8s.io/kubernetes/test/e2e/manifest" + e2emanifest "k8s.io/kubernetes/test/e2e/framework/manifest" ) // CreateStatefulSet creates a StatefulSet from the manifest at manifestPath in the Namespace ns using kubectl create. @@ -43,10 +43,10 @@ func CreateStatefulSet(c clientset.Interface, manifestPath, ns string) *appsv1.S } framework.Logf("Parsing statefulset from %v", mkpath("statefulset.yaml")) - ss, err := manifest.StatefulSetFromManifest(mkpath("statefulset.yaml"), ns) + ss, err := e2emanifest.StatefulSetFromManifest(mkpath("statefulset.yaml"), ns) framework.ExpectNoError(err) framework.Logf("Parsing service from %v", mkpath("service.yaml")) - svc, err := manifest.SvcFromManifest(mkpath("service.yaml")) + svc, err := e2emanifest.SvcFromManifest(mkpath("service.yaml")) framework.ExpectNoError(err) framework.Logf(fmt.Sprintf("creating " + ss.Name + " service"))