Skip to content

Commit 58b59ae

Browse files
committed
Update test data to reflect code move to staging
1 parent e2cae23 commit 58b59ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+817
-100
lines changed

pkg/kubectl/cmd/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ go_library(
6060
go_test(
6161
name = "go_default_test",
6262
srcs = ["cmd_test.go"],
63+
data = ["//pkg/kubectl/cmd/plugin/testdata"],
6364
embed = [":go_default_library"],
6465
deps = [
6566
"//staging/src/k8s.io/cli-runtime/pkg/genericclioptions:go_default_library",

pkg/kubectl/cmd/cmd_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func TestKubectlCommandHandlesPlugins(t *testing.T) {
100100
}
101101

102102
if pluginsHandler.executedPlugin != test.expectPlugin {
103-
t.Fatalf("unexpected plugin execution: expedcted %q, got %q", test.expectPlugin, pluginsHandler.executedPlugin)
103+
t.Fatalf("unexpected plugin execution: expected %q, got %q", test.expectPlugin, pluginsHandler.executedPlugin)
104104
}
105105

106106
if len(pluginsHandler.withArgs) != len(test.expectPluginArgs) {

staging/src/k8s.io/kubectl/test/data/openapi/BUILD renamed to pkg/kubectl/cmd/plugin/testdata/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package(default_visibility = ["//visibility:public"])
22

33
filegroup(
4-
name = "openapi",
4+
name = "testdata",
55
srcs = glob([
6-
"**/*.json",
6+
"**/*",
77
]),
88
)
99

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
echo "I am plugin foo"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
# This plugin is a no-op and is used to test plugins
4+
# that overshadow existing kubectl commands

staging/src/k8s.io/kubectl/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ filegroup(
2626
"//staging/src/k8s.io/kubectl/pkg/util:all-srcs",
2727
"//staging/src/k8s.io/kubectl/pkg/validation:all-srcs",
2828
"//staging/src/k8s.io/kubectl/pkg/version:all-srcs",
29-
"//staging/src/k8s.io/kubectl/test/data/openapi:all-srcs",
29+
"//staging/src/k8s.io/kubectl/test/data:all-srcs",
3030
],
3131
tags = ["automanaged"],
3232
visibility = ["//visibility:public"],

staging/src/k8s.io/kubectl/pkg/apply/strategy/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ go_test(
3333
],
3434
data = [
3535
"test_swagger.json",
36-
"//staging/src/k8s.io/kubectl/test/data/openapi",
36+
"//staging/src/k8s.io/kubectl/test/data",
3737
],
3838
embed = [":go_default_library"],
3939
deps = [

staging/src/k8s.io/kubectl/pkg/cmd/annotate/BUILD

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ go_library(
2929
go_test(
3030
name = "go_default_test",
3131
srcs = ["annotate_test.go"],
32-
data = [
33-
"//test/e2e/testing-manifests:all-srcs",
34-
],
32+
data = ["//staging/src/k8s.io/kubectl/test/data"],
3533
embed = [":go_default_library"],
3634
deps = [
3735
"//staging/src/k8s.io/api/core/v1:go_default_library",

staging/src/k8s.io/kubectl/pkg/cmd/annotate/annotate_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ func TestAnnotateObjectFromFile(t *testing.T) {
543543
cmd := NewCmdAnnotate("kubectl", tf, iostreams)
544544
cmd.SetOutput(bufOut)
545545
options := NewAnnotateOptions(iostreams)
546-
options.Filenames = []string{"../../../../test/e2e/testing-manifests/statefulset/cassandra/controller.yaml"}
546+
options.Filenames = []string{"../../../test/data/controller.yaml"}
547547
args := []string{"a=b", "c-"}
548548
if err := options.Complete(tf, cmd, args); err != nil {
549549
t.Fatalf("unexpected error: %v", err)
@@ -574,7 +574,7 @@ func TestAnnotateLocal(t *testing.T) {
574574
cmd := NewCmdAnnotate("kubectl", tf, iostreams)
575575
options := NewAnnotateOptions(iostreams)
576576
options.local = true
577-
options.Filenames = []string{"../../../../test/e2e/testing-manifests/statefulset/cassandra/controller.yaml"}
577+
options.Filenames = []string{"../../../test/data/controller.yaml"}
578578
args := []string{"a=b"}
579579
if err := options.Complete(tf, cmd, args); err != nil {
580580
t.Fatalf("unexpected error: %v", err)

staging/src/k8s.io/kubectl/pkg/cmd/apply/BUILD

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ go_library(
5050
go_test(
5151
name = "go_default_test",
5252
srcs = ["apply_test.go"],
53-
data = [
54-
"//api/openapi-spec",
55-
"//test/fixtures",
56-
],
53+
data = ["//staging/src/k8s.io/kubectl/test/data"],
5754
embed = [":go_default_library"],
5855
deps = [
5956
"//staging/src/k8s.io/api/apps/v1:go_default_library",

0 commit comments

Comments
 (0)