Merge pull request #38792 from mikedanese/bzl-test

Automatic merge from submit-queue (batch tested with PRs 38212, 38792, 39641, 36390, 39005)

build test binary with bazel

I think... this should work
This commit is contained in:
Kubernetes Submit Queue 2017-01-10 19:48:10 -08:00 committed by GitHub
commit ae62c5f047
2 changed files with 15 additions and 7 deletions

View File

@ -1,6 +1,6 @@
git_repository( git_repository(
name = "io_bazel_rules_go", name = "io_bazel_rules_go",
commit = "c7e02c851a8faf803f260800e7387248ccd47683", commit = "d0142854a22a0dd98306280e897e64086289a0de",
remote = "https://github.com/bazelbuild/rules_go.git", remote = "https://github.com/bazelbuild/rules_go.git",
) )

View File

@ -5,6 +5,7 @@ licenses(["notice"])
load( load(
"@io_bazel_rules_go//go:def.bzl", "@io_bazel_rules_go//go:def.bzl",
"go_library", "go_library",
"go_test",
) )
go_library( go_library(
@ -217,18 +218,17 @@ go_library(
], ],
) )
# this is a private library until we can support building the go_test(
# test binary
# TODO(mikedanese): fix @io_bazelbuild/rules_go
go_library(
name = "go_default_test", name = "go_default_test",
srcs = [ srcs = [
"e2e_test.go", "e2e_test.go",
"metrics_grabber_test.go", "metrics_grabber_test.go",
], ],
library = ":go_default_library", library = ":go_default_library",
tags = ["automanaged"], tags = [
visibility = ["//visibility:private"], "automanaged",
"integration",
],
deps = [ deps = [
"//pkg/api/v1:go_default_library", "//pkg/api/v1:go_default_library",
"//pkg/client/clientset_generated/clientset:go_default_library", "//pkg/client/clientset_generated/clientset:go_default_library",
@ -239,6 +239,14 @@ go_library(
], ],
) )
genrule(
name = "gen_e2e.test",
testonly = 1,
srcs = [":go_default_test"],
outs = ["e2e.test"],
cmd = "set -x; srcs=($(SRCS)); cp $$(dirname $${srcs[0]})/go_default_test $@;",
)
filegroup( filegroup(
name = "package-srcs", name = "package-srcs",
srcs = glob(["**"]), srcs = glob(["**"]),