Update test data to reflect code move to staging

This commit is contained in:
Sean Sullivan
2019-08-01 15:17:53 -07:00
parent e2cae23444
commit 58b59ae4e0
64 changed files with 816 additions and 99 deletions

View File

@@ -60,6 +60,7 @@ go_library(
go_test(
name = "go_default_test",
srcs = ["cmd_test.go"],
data = ["//pkg/kubectl/cmd/plugin/testdata"],
embed = [":go_default_library"],
deps = [
"//staging/src/k8s.io/cli-runtime/pkg/genericclioptions:go_default_library",

View File

@@ -100,7 +100,7 @@ func TestKubectlCommandHandlesPlugins(t *testing.T) {
}
if pluginsHandler.executedPlugin != test.expectPlugin {
t.Fatalf("unexpected plugin execution: expedcted %q, got %q", test.expectPlugin, pluginsHandler.executedPlugin)
t.Fatalf("unexpected plugin execution: expected %q, got %q", test.expectPlugin, pluginsHandler.executedPlugin)
}
if len(pluginsHandler.withArgs) != len(test.expectPluginArgs) {

22
pkg/kubectl/cmd/plugin/testdata/BUILD vendored Normal file
View File

@@ -0,0 +1,22 @@
package(default_visibility = ["//visibility:public"])
filegroup(
name = "testdata",
srcs = glob([
"**/*",
]),
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

3
pkg/kubectl/cmd/plugin/testdata/kubectl-foo vendored Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
echo "I am plugin foo"

View File

@@ -0,0 +1,4 @@
#!/bin/bash
# This plugin is a no-op and is used to test plugins
# that overshadow existing kubectl commands