diff --git a/pkg/apply/strategy/utils_test.go b/pkg/apply/strategy/utils_test.go index c06a34397..fde091fc4 100644 --- a/pkg/apply/strategy/utils_test.go +++ b/pkg/apply/strategy/utils_test.go @@ -37,7 +37,7 @@ const ( noConflict = false ) -var fakeResources = tst.NewFakeResources(filepath.Join("..", "..", "..", "test", "data", "openapi", "swagger.json")) +var fakeResources = tst.NewFakeResources(filepath.Join("..", "..", "..", "testdata", "openapi", "swagger.json")) // run parses the openapi and runs the tests func run(instance apply.Strategy, recorded, local, remote, expected map[string]interface{}) { diff --git a/pkg/cmd/annotate/annotate_test.go b/pkg/cmd/annotate/annotate_test.go index acbe03588..883faf625 100644 --- a/pkg/cmd/annotate/annotate_test.go +++ b/pkg/cmd/annotate/annotate_test.go @@ -543,7 +543,7 @@ func TestAnnotateObjectFromFile(t *testing.T) { cmd := NewCmdAnnotate("kubectl", tf, iostreams) cmd.SetOutput(bufOut) options := NewAnnotateOptions(iostreams) - options.Filenames = []string{"../../../test/data/controller.yaml"} + options.Filenames = []string{"../../../testdata/controller.yaml"} args := []string{"a=b", "c-"} if err := options.Complete(tf, cmd, args); err != nil { t.Fatalf("unexpected error: %v", err) @@ -574,7 +574,7 @@ func TestAnnotateLocal(t *testing.T) { cmd := NewCmdAnnotate("kubectl", tf, iostreams) options := NewAnnotateOptions(iostreams) options.local = true - options.Filenames = []string{"../../../test/data/controller.yaml"} + options.Filenames = []string{"../../../testdata/controller.yaml"} args := []string{"a=b"} if err := options.Complete(tf, cmd, args); err != nil { t.Fatalf("unexpected error: %v", err) diff --git a/pkg/cmd/apply/apply_test.go b/pkg/cmd/apply/apply_test.go index 0e92a3971..ed66f5f62 100644 --- a/pkg/cmd/apply/apply_test.go +++ b/pkg/cmd/apply/apply_test.go @@ -54,7 +54,7 @@ import ( ) var ( - fakeSchema = sptest.Fake{Path: filepath.Join("..", "..", "..", "test", "data", "openapi", "swagger.json")} + fakeSchema = sptest.Fake{Path: filepath.Join("..", "..", "..", "testdata", "openapi", "swagger.json")} testingOpenAPISchemaFns = []func() (openapi.Resources, error){nil, AlwaysErrorOpenAPISchemaFn, openAPISchemaFn} AlwaysErrorOpenAPISchemaFn = func() (openapi.Resources, error) { return nil, errors.New("cannot get openapi spec") @@ -87,23 +87,23 @@ func validateApplyArgs(cmd *cobra.Command, args []string) error { } const ( - filenameCM = "../../../test/data/apply/cm.yaml" - filenameRC = "../../../test/data/apply/rc.yaml" - filenameRCArgs = "../../../test/data/apply/rc-args.yaml" - filenameRCLastAppliedArgs = "../../../test/data/apply/rc-lastapplied-args.yaml" - filenameRCNoAnnotation = "../../../test/data/apply/rc-no-annotation.yaml" - filenameRCLASTAPPLIED = "../../../test/data/apply/rc-lastapplied.yaml" - filenameSVC = "../../../test/data/apply/service.yaml" - filenameRCSVC = "../../../test/data/apply/rc-service.yaml" - filenameNoExistRC = "../../../test/data/apply/rc-noexist.yaml" - filenameRCPatchTest = "../../../test/data/apply/patch.json" - dirName = "../../../test/data/apply/testdir" - filenameRCJSON = "../../../test/data/apply/rc.json" + filenameCM = "../../../testdata/apply/cm.yaml" + filenameRC = "../../../testdata/apply/rc.yaml" + filenameRCArgs = "../../../testdata/apply/rc-args.yaml" + filenameRCLastAppliedArgs = "../../../testdata/apply/rc-lastapplied-args.yaml" + filenameRCNoAnnotation = "../../../testdata/apply/rc-no-annotation.yaml" + filenameRCLASTAPPLIED = "../../../testdata/apply/rc-lastapplied.yaml" + filenameSVC = "../../../testdata/apply/service.yaml" + filenameRCSVC = "../../../testdata/apply/rc-service.yaml" + filenameNoExistRC = "../../../testdata/apply/rc-noexist.yaml" + filenameRCPatchTest = "../../../testdata/apply/patch.json" + dirName = "../../../testdata/apply/testdir" + filenameRCJSON = "../../../testdata/apply/rc.json" - filenameWidgetClientside = "../../../test/data/apply/widget-clientside.yaml" - filenameWidgetServerside = "../../../test/data/apply/widget-serverside.yaml" - filenameDeployObjServerside = "../../../test/data/apply/deploy-serverside.yaml" - filenameDeployObjClientside = "../../../test/data/apply/deploy-clientside.yaml" + filenameWidgetClientside = "../../../testdata/apply/widget-clientside.yaml" + filenameWidgetServerside = "../../../testdata/apply/widget-serverside.yaml" + filenameDeployObjServerside = "../../../testdata/apply/deploy-serverside.yaml" + filenameDeployObjClientside = "../../../testdata/apply/deploy-clientside.yaml" ) func readConfigMapList(t *testing.T, filename string) [][]byte { diff --git a/pkg/cmd/create/create_test.go b/pkg/cmd/create/create_test.go index e817f7299..fdb94cafb 100644 --- a/pkg/cmd/create/create_test.go +++ b/pkg/cmd/create/create_test.go @@ -67,7 +67,7 @@ func TestCreateObject(t *testing.T) { ioStreams, _, buf, _ := genericclioptions.NewTestIOStreams() cmd := NewCmdCreate(tf, ioStreams) - cmd.Flags().Set("filename", "../../../test/data/redis-master-controller.yaml") + cmd.Flags().Set("filename", "../../../testdata/redis-master-controller.yaml") cmd.Flags().Set("output", "name") cmd.Run(cmd, []string{}) @@ -104,8 +104,8 @@ func TestCreateMultipleObject(t *testing.T) { ioStreams, _, buf, _ := genericclioptions.NewTestIOStreams() cmd := NewCmdCreate(tf, ioStreams) - cmd.Flags().Set("filename", "../../../test/data/redis-master-controller.yaml") - cmd.Flags().Set("filename", "../../../test/data/frontend-service.yaml") + cmd.Flags().Set("filename", "../../../testdata/redis-master-controller.yaml") + cmd.Flags().Set("filename", "../../../testdata/frontend-service.yaml") cmd.Flags().Set("output", "name") cmd.Run(cmd, []string{}) @@ -141,7 +141,7 @@ func TestCreateDirectory(t *testing.T) { ioStreams, _, buf, _ := genericclioptions.NewTestIOStreams() cmd := NewCmdCreate(tf, ioStreams) - cmd.Flags().Set("filename", "../../../test/data/replace/legacy") + cmd.Flags().Set("filename", "../../../testdata/replace/legacy") cmd.Flags().Set("output", "name") cmd.Run(cmd, []string{}) diff --git a/pkg/cmd/delete/delete_test.go b/pkg/cmd/delete/delete_test.go index f587060bb..eae6a0283 100644 --- a/pkg/cmd/delete/delete_test.go +++ b/pkg/cmd/delete/delete_test.go @@ -237,7 +237,7 @@ func TestDeleteObject(t *testing.T) { streams, _, buf, _ := genericclioptions.NewTestIOStreams() cmd := NewCmdDelete(tf, streams) - cmd.Flags().Set("filename", "../../../test/data/redis-master-controller.yaml") + cmd.Flags().Set("filename", "../../../testdata/redis-master-controller.yaml") cmd.Flags().Set("cascade", "false") cmd.Flags().Set("output", "name") cmd.Run(cmd, []string{}) @@ -317,7 +317,7 @@ func TestDeleteObjectNotFound(t *testing.T) { options := &DeleteOptions{ FilenameOptions: resource.FilenameOptions{ - Filenames: []string{"../../../test/data/redis-master-controller.yaml"}, + Filenames: []string{"../../../testdata/redis-master-controller.yaml"}, }, GracePeriod: -1, Cascade: false, @@ -354,7 +354,7 @@ func TestDeleteObjectIgnoreNotFound(t *testing.T) { streams, _, buf, _ := genericclioptions.NewTestIOStreams() cmd := NewCmdDelete(tf, streams) - cmd.Flags().Set("filename", "../../../test/data/redis-master-controller.yaml") + cmd.Flags().Set("filename", "../../../testdata/redis-master-controller.yaml") cmd.Flags().Set("cascade", "false") cmd.Flags().Set("ignore-not-found", "true") cmd.Flags().Set("output", "name") @@ -482,8 +482,8 @@ func TestDeleteMultipleObject(t *testing.T) { streams, _, buf, _ := genericclioptions.NewTestIOStreams() cmd := NewCmdDelete(tf, streams) - cmd.Flags().Set("filename", "../../../test/data/redis-master-controller.yaml") - cmd.Flags().Set("filename", "../../../test/data/frontend-service.yaml") + cmd.Flags().Set("filename", "../../../testdata/redis-master-controller.yaml") + cmd.Flags().Set("filename", "../../../testdata/frontend-service.yaml") cmd.Flags().Set("cascade", "false") cmd.Flags().Set("output", "name") cmd.Run(cmd, []string{}) @@ -520,7 +520,7 @@ func TestDeleteMultipleObjectContinueOnMissing(t *testing.T) { options := &DeleteOptions{ FilenameOptions: resource.FilenameOptions{ - Filenames: []string{"../../../test/data/redis-master-controller.yaml", "../../../test/data/frontend-service.yaml"}, + Filenames: []string{"../../../testdata/redis-master-controller.yaml", "../../../testdata/frontend-service.yaml"}, }, GracePeriod: -1, Cascade: false, @@ -604,7 +604,7 @@ func TestDeleteDirectory(t *testing.T) { streams, _, buf, _ := genericclioptions.NewTestIOStreams() cmd := NewCmdDelete(tf, streams) - cmd.Flags().Set("filename", "../../../test/data/replace/legacy") + cmd.Flags().Set("filename", "../../../testdata/replace/legacy") cmd.Flags().Set("cascade", "false") cmd.Flags().Set("output", "name") cmd.Run(cmd, []string{}) diff --git a/pkg/cmd/describe/describe_test.go b/pkg/cmd/describe/describe_test.go index d758e159f..a368cfe95 100644 --- a/pkg/cmd/describe/describe_test.go +++ b/pkg/cmd/describe/describe_test.go @@ -126,7 +126,7 @@ func TestDescribeObject(t *testing.T) { streams, _, buf, _ := genericclioptions.NewTestIOStreams() cmd := NewCmdDescribe("kubectl", tf, streams) - cmd.Flags().Set("filename", "../../../test/data/redis-master-controller.yaml") + cmd.Flags().Set("filename", "../../../testdata/redis-master-controller.yaml") cmd.Run(cmd, []string{}) if d.Name != "redis-master" || d.Namespace != "test" { diff --git a/pkg/cmd/expose/expose_test.go b/pkg/cmd/expose/expose_test.go index 267d5d0c0..45dfd0fd7 100644 --- a/pkg/cmd/expose/expose_test.go +++ b/pkg/cmd/expose/expose_test.go @@ -306,7 +306,7 @@ func TestRunExposeService(t *testing.T) { Selector: map[string]string{"app": "go"}, }, }, - flags: map[string]string{"filename": "../../../test/data/redis-master-service.yaml", "selector": "func=stream", "protocol": "UDP", "port": "14", "name": "foo", "labels": "svc=test", "dry-run": "true"}, + flags: map[string]string{"filename": "../../../testdata/redis-master-service.yaml", "selector": "func=stream", "protocol": "UDP", "port": "14", "name": "foo", "labels": "svc=test", "dry-run": "true"}, output: &corev1.Service{ ObjectMeta: metav1.ObjectMeta{Name: "foo", Labels: map[string]string{"svc": "test"}}, Spec: corev1.ServiceSpec{ diff --git a/pkg/cmd/get/get_test.go b/pkg/cmd/get/get_test.go index 425220adb..767e77c08 100644 --- a/pkg/cmd/get/get_test.go +++ b/pkg/cmd/get/get_test.go @@ -54,8 +54,7 @@ import ( ) var ( - openapiSchemaPath = filepath.Join("..", "..", "..", "..", "api", "openapi-spec", "swagger.json") - + openapiSchemaPath = filepath.Join("..", "..", "..", "testdata", "openapi", "swagger.json") grace = int64(30) enableServiceLinks = corev1.DefaultEnableServiceLinks ) @@ -1079,7 +1078,7 @@ func TestGetObjectsIdentifiedByFile(t *testing.T) { streams, _, buf, _ := genericclioptions.NewTestIOStreams() cmd := NewCmdGet("kubectl", tf, streams) cmd.SetOutput(buf) - cmd.Flags().Set("filename", "../../../test/data/controller.yaml") + cmd.Flags().Set("filename", "../../../testdata/controller.yaml") cmd.Run(cmd, []string{}) expected := `NAME AGE @@ -1105,7 +1104,7 @@ func TestGetTableObjectsIdentifiedByFile(t *testing.T) { streams, _, buf, _ := genericclioptions.NewTestIOStreams() cmd := NewCmdGet("kubectl", tf, streams) cmd.SetOutput(buf) - cmd.Flags().Set("filename", "../../../test/data/controller.yaml") + cmd.Flags().Set("filename", "../../../testdata/controller.yaml") cmd.Run(cmd, []string{}) expected := `NAME READY STATUS RESTARTS AGE @@ -2495,7 +2494,7 @@ func TestWatchResourceIdentifiedByFile(t *testing.T) { cmd.SetOutput(buf) cmd.Flags().Set("watch", "true") - cmd.Flags().Set("filename", "../../../test/data/controller.yaml") + cmd.Flags().Set("filename", "../../../testdata/controller.yaml") cmd.Run(cmd, []string{}) expected := `NAME AGE diff --git a/pkg/cmd/label/label_test.go b/pkg/cmd/label/label_test.go index f26341672..066a069c8 100644 --- a/pkg/cmd/label/label_test.go +++ b/pkg/cmd/label/label_test.go @@ -392,7 +392,7 @@ func TestLabelForResourceFromFile(t *testing.T) { ioStreams, _, buf, _ := genericclioptions.NewTestIOStreams() cmd := NewCmdLabel(tf, ioStreams) opts := NewLabelOptions(ioStreams) - opts.Filenames = []string{"../../../test/data/controller.yaml"} + opts.Filenames = []string{"../../../testdata/controller.yaml"} err := opts.Complete(tf, cmd, []string{"a=b"}) if err == nil { err = opts.Validate() @@ -424,7 +424,7 @@ func TestLabelLocal(t *testing.T) { ioStreams, _, buf, _ := genericclioptions.NewTestIOStreams() cmd := NewCmdLabel(tf, ioStreams) opts := NewLabelOptions(ioStreams) - opts.Filenames = []string{"../../../test/data/controller.yaml"} + opts.Filenames = []string{"../../../testdata/controller.yaml"} opts.local = true err := opts.Complete(tf, cmd, []string{"a=b"}) if err == nil { diff --git a/pkg/cmd/patch/patch_test.go b/pkg/cmd/patch/patch_test.go index ac3335c5a..fb87dd247 100644 --- a/pkg/cmd/patch/patch_test.go +++ b/pkg/cmd/patch/patch_test.go @@ -95,7 +95,7 @@ func TestPatchObjectFromFile(t *testing.T) { cmd.Flags().Set("namespace", "test") cmd.Flags().Set("patch", `{"spec":{"type":"NodePort"}}`) cmd.Flags().Set("output", "name") - cmd.Flags().Set("filename", "../../../test/data/frontend-service.yaml") + cmd.Flags().Set("filename", "../../../testdata/frontend-service.yaml") cmd.Run(cmd, []string{}) // uses the name from the response @@ -181,7 +181,7 @@ func TestPatchObjectFromFileOutput(t *testing.T) { cmd.Flags().Set("namespace", "test") cmd.Flags().Set("patch", `{"spec":{"type":"NodePort"}}`) cmd.Flags().Set("output", "yaml") - cmd.Flags().Set("filename", "../../../test/data/frontend-service.yaml") + cmd.Flags().Set("filename", "../../../testdata/frontend-service.yaml") cmd.Run(cmd, []string{}) t.Log(buf.String()) diff --git a/pkg/cmd/replace/replace_test.go b/pkg/cmd/replace/replace_test.go index e2a2b8f8b..52b3486f6 100644 --- a/pkg/cmd/replace/replace_test.go +++ b/pkg/cmd/replace/replace_test.go @@ -65,7 +65,7 @@ func TestReplaceObject(t *testing.T) { streams, _, buf, _ := genericclioptions.NewTestIOStreams() cmd := NewCmdReplace(tf, streams) - cmd.Flags().Set("filename", "../../../test/data/redis-master-controller.yaml") + cmd.Flags().Set("filename", "../../../testdata/redis-master-controller.yaml") cmd.Flags().Set("output", "name") cmd.Run(cmd, []string{}) @@ -135,8 +135,8 @@ func TestReplaceMultipleObject(t *testing.T) { streams, _, buf, _ := genericclioptions.NewTestIOStreams() cmd := NewCmdReplace(tf, streams) - cmd.Flags().Set("filename", "../../../test/data/redis-master-controller.yaml") - cmd.Flags().Set("filename", "../../../test/data/frontend-service.yaml") + cmd.Flags().Set("filename", "../../../testdata/redis-master-controller.yaml") + cmd.Flags().Set("filename", "../../../testdata/frontend-service.yaml") cmd.Flags().Set("output", "name") cmd.Run(cmd, []string{}) @@ -192,7 +192,7 @@ func TestReplaceDirectory(t *testing.T) { streams, _, buf, _ := genericclioptions.NewTestIOStreams() cmd := NewCmdReplace(tf, streams) - cmd.Flags().Set("filename", "../../../test/data/replace/legacy") + cmd.Flags().Set("filename", "../../../testdata/replace/legacy") cmd.Flags().Set("namespace", "test") cmd.Flags().Set("output", "name") cmd.Run(cmd, []string{}) @@ -238,7 +238,7 @@ func TestForceReplaceObjectNotFound(t *testing.T) { streams, _, buf, _ := genericclioptions.NewTestIOStreams() cmd := NewCmdReplace(tf, streams) - cmd.Flags().Set("filename", "../../../test/data/redis-master-controller.yaml") + cmd.Flags().Set("filename", "../../../testdata/redis-master-controller.yaml") cmd.Flags().Set("force", "true") cmd.Flags().Set("cascade", "false") cmd.Flags().Set("output", "name") diff --git a/pkg/cmd/set/set_env_test.go b/pkg/cmd/set/set_env_test.go index 0e6560cc8..a9d1d9e69 100644 --- a/pkg/cmd/set/set_env_test.go +++ b/pkg/cmd/set/set_env_test.go @@ -60,7 +60,7 @@ func TestSetEnvLocal(t *testing.T) { opts := NewEnvOptions(streams) opts.PrintFlags = genericclioptions.NewPrintFlags("").WithDefaultOutput(outputFormat).WithTypeSetter(scheme.Scheme) opts.FilenameOptions = resource.FilenameOptions{ - Filenames: []string{"../../../test/data/controller.yaml"}, + Filenames: []string{"../../../testdata/controller.yaml"}, } opts.Local = true @@ -97,7 +97,7 @@ func TestSetEnvLocalNamespace(t *testing.T) { opts := NewEnvOptions(streams) opts.PrintFlags = genericclioptions.NewPrintFlags("").WithDefaultOutput(outputFormat).WithTypeSetter(scheme.Scheme) opts.FilenameOptions = resource.FilenameOptions{ - Filenames: []string{"../../../test/data/set/namespaced-resource.yaml"}, + Filenames: []string{"../../../testdata/set/namespaced-resource.yaml"}, } opts.Local = true @@ -134,7 +134,7 @@ func TestSetMultiResourcesEnvLocal(t *testing.T) { opts := NewEnvOptions(streams) opts.PrintFlags = genericclioptions.NewPrintFlags("").WithDefaultOutput(outputFormat).WithTypeSetter(scheme.Scheme) opts.FilenameOptions = resource.FilenameOptions{ - Filenames: []string{"../../../test/data/set/multi-resource-yaml.yaml"}, + Filenames: []string{"../../../testdata/set/multi-resource-yaml.yaml"}, } opts.Local = true diff --git a/pkg/cmd/set/set_image_test.go b/pkg/cmd/set/set_image_test.go index 6cd1ffb29..fd7eeefdc 100644 --- a/pkg/cmd/set/set_image_test.go +++ b/pkg/cmd/set/set_image_test.go @@ -67,7 +67,7 @@ func TestImageLocal(t *testing.T) { opts := SetImageOptions{ PrintFlags: genericclioptions.NewPrintFlags("").WithDefaultOutput(outputFormat).WithTypeSetter(scheme.Scheme), FilenameOptions: resource.FilenameOptions{ - Filenames: []string{"../../../test/data/controller.yaml"}}, + Filenames: []string{"../../../testdata/controller.yaml"}}, Local: true, IOStreams: streams, } @@ -179,7 +179,7 @@ func TestSetMultiResourcesImageLocal(t *testing.T) { opts := SetImageOptions{ PrintFlags: genericclioptions.NewPrintFlags("").WithDefaultOutput(outputFormat).WithTypeSetter(scheme.Scheme), FilenameOptions: resource.FilenameOptions{ - Filenames: []string{"../../../test/data/set/multi-resource-yaml.yaml"}}, + Filenames: []string{"../../../testdata/set/multi-resource-yaml.yaml"}}, Local: true, IOStreams: streams, } diff --git a/pkg/cmd/set/set_resources_test.go b/pkg/cmd/set/set_resources_test.go index cc8202640..0fe25d349 100644 --- a/pkg/cmd/set/set_resources_test.go +++ b/pkg/cmd/set/set_resources_test.go @@ -66,7 +66,7 @@ func TestResourcesLocal(t *testing.T) { opts := SetResourcesOptions{ PrintFlags: genericclioptions.NewPrintFlags("").WithDefaultOutput(outputFormat).WithTypeSetter(scheme.Scheme), FilenameOptions: resource.FilenameOptions{ - Filenames: []string{"../../../test/data/controller.yaml"}}, + Filenames: []string{"../../../testdata/controller.yaml"}}, Local: true, Limits: "cpu=200m,memory=512Mi", Requests: "cpu=200m,memory=512Mi", @@ -114,7 +114,7 @@ func TestSetMultiResourcesLimitsLocal(t *testing.T) { opts := SetResourcesOptions{ PrintFlags: genericclioptions.NewPrintFlags("").WithDefaultOutput(outputFormat).WithTypeSetter(scheme.Scheme), FilenameOptions: resource.FilenameOptions{ - Filenames: []string{"../../../test/data/set/multi-resource-yaml.yaml"}}, + Filenames: []string{"../../../testdata/set/multi-resource-yaml.yaml"}}, Local: true, Limits: "cpu=200m,memory=512Mi", Requests: "cpu=200m,memory=512Mi", diff --git a/pkg/cmd/set/set_serviceaccount_test.go b/pkg/cmd/set/set_serviceaccount_test.go index aa7e3dd63..064b07410 100644 --- a/pkg/cmd/set/set_serviceaccount_test.go +++ b/pkg/cmd/set/set_serviceaccount_test.go @@ -57,11 +57,11 @@ func TestSetServiceAccountLocal(t *testing.T) { yaml string apiGroup string }{ - {yaml: "../../../test/data/set/replication.yaml", apiGroup: ""}, - {yaml: "../../../test/data/set/daemon.yaml", apiGroup: "extensions"}, - {yaml: "../../../test/data/set/redis-slave.yaml", apiGroup: "extensions"}, - {yaml: "../../../test/data/set/job.yaml", apiGroup: "batch"}, - {yaml: "../../../test/data/set/deployment.yaml", apiGroup: "extensions"}, + {yaml: "../../../testdata/set/replication.yaml", apiGroup: ""}, + {yaml: "../../../testdata/set/daemon.yaml", apiGroup: "extensions"}, + {yaml: "../../../testdata/set/redis-slave.yaml", apiGroup: "extensions"}, + {yaml: "../../../testdata/set/job.yaml", apiGroup: "batch"}, + {yaml: "../../../testdata/set/deployment.yaml", apiGroup: "extensions"}, } for i, input := range inputs { @@ -122,7 +122,7 @@ func TestSetServiceAccountMultiLocal(t *testing.T) { opts := SetServiceAccountOptions{ PrintFlags: genericclioptions.NewPrintFlags("").WithDefaultOutput(outputFormat).WithTypeSetter(scheme.Scheme), fileNameOptions: resource.FilenameOptions{ - Filenames: []string{"../../../test/data/set/multi-resource-yaml.yaml"}}, + Filenames: []string{"../../../testdata/set/multi-resource-yaml.yaml"}}, local: true, IOStreams: streams, } diff --git a/pkg/util/openapi/openapi_test.go b/pkg/util/openapi/openapi_test.go index 3a64ed7ca..d1649d79c 100644 --- a/pkg/util/openapi/openapi_test.go +++ b/pkg/util/openapi/openapi_test.go @@ -28,7 +28,7 @@ import ( "k8s.io/kubectl/pkg/util/openapi" ) -var fakeSchema = testing.Fake{Path: filepath.Join("..", "..", "..", "test", "data", "openapi", "swagger.json")} +var fakeSchema = testing.Fake{Path: filepath.Join("..", "..", "..", "testdata", "openapi", "swagger.json")} var _ = Describe("Reading apps/v1beta1/Deployment from openAPIData", func() { var resources openapi.Resources diff --git a/pkg/util/openapi/validation/validation_test.go b/pkg/util/openapi/validation/validation_test.go index cd4517c39..7d8cbc519 100644 --- a/pkg/util/openapi/validation/validation_test.go +++ b/pkg/util/openapi/validation/validation_test.go @@ -30,7 +30,7 @@ import ( "k8s.io/kubectl/pkg/util/openapi" ) -var fakeSchema = testing.Fake{Path: filepath.Join("..", "..", "..", "..", "test", "data", "openapi", "swagger.json")} +var fakeSchema = testing.Fake{Path: filepath.Join("..", "..", "..", "..", "testdata", "openapi", "swagger.json")} var _ = Describe("resource validation using OpenAPI Schema", func() { var validator *SchemaValidation diff --git a/test/data/apply/cm.yaml b/testdata/apply/cm.yaml similarity index 100% rename from test/data/apply/cm.yaml rename to testdata/apply/cm.yaml diff --git a/test/data/apply/deploy-clientside.yaml b/testdata/apply/deploy-clientside.yaml similarity index 100% rename from test/data/apply/deploy-clientside.yaml rename to testdata/apply/deploy-clientside.yaml diff --git a/test/data/apply/deploy-serverside.yaml b/testdata/apply/deploy-serverside.yaml similarity index 100% rename from test/data/apply/deploy-serverside.yaml rename to testdata/apply/deploy-serverside.yaml diff --git a/test/data/apply/patch.json b/testdata/apply/patch.json similarity index 100% rename from test/data/apply/patch.json rename to testdata/apply/patch.json diff --git a/test/data/apply/rc-args.yaml b/testdata/apply/rc-args.yaml similarity index 100% rename from test/data/apply/rc-args.yaml rename to testdata/apply/rc-args.yaml diff --git a/test/data/apply/rc-lastapplied-args.yaml b/testdata/apply/rc-lastapplied-args.yaml similarity index 100% rename from test/data/apply/rc-lastapplied-args.yaml rename to testdata/apply/rc-lastapplied-args.yaml diff --git a/test/data/apply/rc-lastapplied.yaml b/testdata/apply/rc-lastapplied.yaml similarity index 100% rename from test/data/apply/rc-lastapplied.yaml rename to testdata/apply/rc-lastapplied.yaml diff --git a/test/data/apply/rc-no-annotation.yaml b/testdata/apply/rc-no-annotation.yaml similarity index 100% rename from test/data/apply/rc-no-annotation.yaml rename to testdata/apply/rc-no-annotation.yaml diff --git a/test/data/apply/rc-noexist.yaml b/testdata/apply/rc-noexist.yaml similarity index 100% rename from test/data/apply/rc-noexist.yaml rename to testdata/apply/rc-noexist.yaml diff --git a/test/data/apply/rc-service.yaml b/testdata/apply/rc-service.yaml similarity index 100% rename from test/data/apply/rc-service.yaml rename to testdata/apply/rc-service.yaml diff --git a/test/data/apply/rc.json b/testdata/apply/rc.json similarity index 100% rename from test/data/apply/rc.json rename to testdata/apply/rc.json diff --git a/test/data/apply/rc.yaml b/testdata/apply/rc.yaml similarity index 100% rename from test/data/apply/rc.yaml rename to testdata/apply/rc.yaml diff --git a/test/data/apply/service.yaml b/testdata/apply/service.yaml similarity index 100% rename from test/data/apply/service.yaml rename to testdata/apply/service.yaml diff --git a/test/data/apply/testdir/rc.yaml b/testdata/apply/testdir/rc.yaml similarity index 100% rename from test/data/apply/testdir/rc.yaml rename to testdata/apply/testdir/rc.yaml diff --git a/test/data/apply/testdir/rc1.yaml b/testdata/apply/testdir/rc1.yaml similarity index 100% rename from test/data/apply/testdir/rc1.yaml rename to testdata/apply/testdir/rc1.yaml diff --git a/test/data/apply/widget-clientside.yaml b/testdata/apply/widget-clientside.yaml similarity index 100% rename from test/data/apply/widget-clientside.yaml rename to testdata/apply/widget-clientside.yaml diff --git a/test/data/apply/widget-serverside.yaml b/testdata/apply/widget-serverside.yaml similarity index 100% rename from test/data/apply/widget-serverside.yaml rename to testdata/apply/widget-serverside.yaml diff --git a/test/data/controller.yaml b/testdata/controller.yaml similarity index 100% rename from test/data/controller.yaml rename to testdata/controller.yaml diff --git a/test/data/frontend-service.yaml b/testdata/frontend-service.yaml similarity index 100% rename from test/data/frontend-service.yaml rename to testdata/frontend-service.yaml diff --git a/test/data/openapi/swagger.json b/testdata/openapi/swagger.json similarity index 100% rename from test/data/openapi/swagger.json rename to testdata/openapi/swagger.json diff --git a/test/data/redis-master-controller.yaml b/testdata/redis-master-controller.yaml similarity index 100% rename from test/data/redis-master-controller.yaml rename to testdata/redis-master-controller.yaml diff --git a/test/data/redis-master-service.yaml b/testdata/redis-master-service.yaml similarity index 100% rename from test/data/redis-master-service.yaml rename to testdata/redis-master-service.yaml diff --git a/test/data/replace/legacy/frontend-controller.yaml b/testdata/replace/legacy/frontend-controller.yaml similarity index 100% rename from test/data/replace/legacy/frontend-controller.yaml rename to testdata/replace/legacy/frontend-controller.yaml diff --git a/test/data/replace/legacy/redis-master-controller.yaml b/testdata/replace/legacy/redis-master-controller.yaml similarity index 100% rename from test/data/replace/legacy/redis-master-controller.yaml rename to testdata/replace/legacy/redis-master-controller.yaml diff --git a/test/data/replace/legacy/redis-slave-controller.yaml b/testdata/replace/legacy/redis-slave-controller.yaml similarity index 100% rename from test/data/replace/legacy/redis-slave-controller.yaml rename to testdata/replace/legacy/redis-slave-controller.yaml diff --git a/test/data/set/daemon.yaml b/testdata/set/daemon.yaml similarity index 100% rename from test/data/set/daemon.yaml rename to testdata/set/daemon.yaml diff --git a/test/data/set/deployment.yaml b/testdata/set/deployment.yaml similarity index 100% rename from test/data/set/deployment.yaml rename to testdata/set/deployment.yaml diff --git a/test/data/set/job.yaml b/testdata/set/job.yaml similarity index 100% rename from test/data/set/job.yaml rename to testdata/set/job.yaml diff --git a/test/data/set/multi-resource-yaml.yaml b/testdata/set/multi-resource-yaml.yaml similarity index 100% rename from test/data/set/multi-resource-yaml.yaml rename to testdata/set/multi-resource-yaml.yaml diff --git a/test/data/set/namespaced-resource.yaml b/testdata/set/namespaced-resource.yaml similarity index 100% rename from test/data/set/namespaced-resource.yaml rename to testdata/set/namespaced-resource.yaml diff --git a/test/data/set/redis-slave.yaml b/testdata/set/redis-slave.yaml similarity index 100% rename from test/data/set/redis-slave.yaml rename to testdata/set/redis-slave.yaml diff --git a/test/data/set/replication.yaml b/testdata/set/replication.yaml similarity index 100% rename from test/data/set/replication.yaml rename to testdata/set/replication.yaml