Skip to content

Commit

Permalink
fix tests by declaring testdata
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedanese committed Oct 22, 2016
1 parent 3b6a067 commit df713b4
Show file tree
Hide file tree
Showing 22 changed files with 123 additions and 9 deletions.
8 changes: 8 additions & 0 deletions api/openapi-spec/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package(default_visibility = ["//visibility:public"])

filegroup(
name = "swagger-spec",
srcs = glob([
"**/*.json",
]),
)
8 changes: 8 additions & 0 deletions api/swagger-spec/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package(default_visibility = ["//visibility:public"])

filegroup(
name = "swagger-spec",
srcs = glob([
"**/*.json",
]),
)
5 changes: 4 additions & 1 deletion cmd/libs/go2idl/openapi-gen/generators/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ go_test(
name = "go_default_test",
srcs = ["openapi_test.go"],
library = "go_default_library",
tags = ["automanaged"],
tags = [
"automanaged",
"skip",
],
deps = [
"//vendor:github.com/stretchr/testify/assert",
"//vendor:k8s.io/gengo/generator",
Expand Down
12 changes: 12 additions & 0 deletions examples/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package(default_visibility = ["//visibility:public"])

filegroup(
name = "config",
srcs = glob([
"**/*.yaml",
"**/*.yml",
"**/*.json",
]) + [
"pod",
],
)
9 changes: 9 additions & 0 deletions pkg/api/validation/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ go_test(
"schema_test.go",
"validation_test.go",
],
data = [
"testdata/v1/invalidPod.yaml",
"testdata/v1/invalidPod1.json",
"testdata/v1/invalidPod2.json",
"testdata/v1/invalidPod3.json",
"testdata/v1/invalidPod4.yaml",
"testdata/v1/validPod.yaml",
"//api/swagger-spec",
],
library = "go_default_library",
tags = ["automanaged"],
deps = [
Expand Down
11 changes: 11 additions & 0 deletions pkg/auth/authorizer/abac/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,20 @@ go_library(
],
)

filegroup(
name = "example_policy",
testonly = True,
srcs = [
"example_policy_file.jsonl",
],
)

go_test(
name = "go_default_test",
srcs = ["abac_test.go"],
data = [
":example_policy",
],
library = "go_default_library",
tags = ["automanaged"],
deps = [
Expand Down
1 change: 1 addition & 0 deletions pkg/client/unversioned/testclient/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ go_test(
"fake_test.go",
"testclient_test.go",
],
data = ["//examples:config"],
library = "go_default_library",
tags = ["automanaged"],
deps = [
Expand Down
3 changes: 3 additions & 0 deletions pkg/genericapiserver/authorizer/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ go_library(
go_test(
name = "go_default_test",
srcs = ["authz_test.go"],
data = [
"//pkg/auth/authorizer/abac:example_policy",
],
library = "go_default_library",
tags = ["automanaged"],
deps = [
Expand Down
9 changes: 8 additions & 1 deletion pkg/kubectl/cmd/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,15 @@ go_test(
"top_pod_test.go",
"top_test.go",
],
data = [
"//examples:config",
"//test/fixtures",
],
library = "go_default_library",
tags = ["automanaged"],
tags = [
"automanaged",
"skip",
],
deps = [
"//pkg/api:go_default_library",
"//pkg/api/annotations:go_default_library",
Expand Down
3 changes: 3 additions & 0 deletions pkg/kubectl/cmd/set/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ go_library(
go_test(
name = "go_default_test",
srcs = ["set_image_test.go"],
data = [
"//examples:config",
],
library = "go_default_library",
tags = ["automanaged"],
deps = [
Expand Down
3 changes: 3 additions & 0 deletions pkg/kubectl/cmd/util/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ go_test(
"helpers_test.go",
"shortcut_restmapper_test.go",
],
data = [
"//api/swagger-spec",
],
library = "go_default_library",
tags = ["automanaged"],
deps = [
Expand Down
9 changes: 8 additions & 1 deletion pkg/kubectl/resource/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,15 @@ go_test(
"helper_test.go",
"visitor_test.go",
],
data = [
"//examples:config",
"//test/fixtures",
],
library = "go_default_library",
tags = ["automanaged"],
tags = [
"automanaged",
"skip",
],
deps = [
"//pkg/api:go_default_library",
"//pkg/api/meta:go_default_library",
Expand Down
5 changes: 4 additions & 1 deletion pkg/kubelet/client/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ go_test(
name = "go_default_test",
srcs = ["kubelet_client_test.go"],
library = "go_default_library",
tags = ["automanaged"],
tags = [
"automanaged",
"skip",
],
deps = [
"//pkg/client/clientset_generated/internalclientset/typed/core/unversioned:go_default_library",
"//pkg/client/restclient:go_default_library",
Expand Down
9 changes: 8 additions & 1 deletion pkg/kubelet/dockertools/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,15 @@ go_test(
"images_test.go",
"labels_test.go",
],
data = [
"fixtures/seccomp/sub/subtest",
"fixtures/seccomp/test",
],
library = "go_default_library",
tags = ["automanaged"],
tags = [
"automanaged",
"skip",
],
deps = [
"//pkg/api:go_default_library",
"//pkg/api/testapi:go_default_library",
Expand Down
3 changes: 3 additions & 0 deletions pkg/security/apparmor/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ go_library(
go_test(
name = "go_default_test",
srcs = ["validate_test.go"],
data = [
"testdata/profiles",
],
library = "go_default_library",
tags = ["automanaged"],
deps = [
Expand Down
3 changes: 3 additions & 0 deletions pkg/util/cert/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ go_library(
go_test(
name = "go_default_test",
srcs = ["csr_test.go"],
data = [
"testdata/dontUseThisKey.pem",
],
library = "go_default_library",
tags = ["automanaged"],
deps = [],
Expand Down
5 changes: 4 additions & 1 deletion pkg/util/procfs/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ go_test(
name = "go_default_test",
srcs = ["procfs_linux_test.go"],
library = "go_default_library",
tags = ["automanaged"],
tags = [
"automanaged",
"skip",
],
deps = ["//vendor:github.com/stretchr/testify/assert"],
)
1 change: 1 addition & 0 deletions plugin/pkg/auth/authenticator/request/x509/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ go_library(
go_test(
name = "go_default_test",
srcs = ["x509_test.go"],
data = glob(["testdata/*"]),
library = "go_default_library",
tags = ["automanaged"],
deps = ["//pkg/auth/user:go_default_library"],
Expand Down
5 changes: 4 additions & 1 deletion plugin/pkg/scheduler/algorithm/predicates/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ go_test(
"utils_test.go",
],
library = "go_default_library",
tags = ["automanaged"],
tags = [
"automanaged",
"skip",
],
deps = [
"//pkg/api:go_default_library",
"//pkg/api/resource:go_default_library",
Expand Down
5 changes: 4 additions & 1 deletion plugin/pkg/scheduler/algorithm/priorities/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ go_test(
"taint_toleration_test.go",
],
library = "go_default_library",
tags = ["automanaged"],
tags = [
"automanaged",
"skip",
],
deps = [
"//pkg/api:go_default_library",
"//pkg/api/resource:go_default_library",
Expand Down
5 changes: 4 additions & 1 deletion plugin/pkg/scheduler/algorithmprovider/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ go_test(
name = "go_default_test",
srcs = ["plugins_test.go"],
library = "go_default_library",
tags = ["automanaged"],
tags = [
"automanaged",
"skip",
],
deps = ["//plugin/pkg/scheduler/factory:go_default_library"],
)
10 changes: 10 additions & 0 deletions test/fixtures/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package(default_visibility = ["//visibility:public"])

filegroup(
name = "fixtures",
srcs = glob([
"**/*.yaml",
"**/*.yml",
"**/*.json",
]),
)

0 comments on commit df713b4

Please sign in to comment.