build test binary with bazel

pull/6/head
Mike Danese 2016-12-14 15:55:23 -08:00
parent ee177dbbfe
commit c2b5007f1c
2 changed files with 15 additions and 7 deletions

View File

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

View File

@ -5,6 +5,7 @@ licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
"go_test",
)
go_library(
@ -218,18 +219,17 @@ go_library(
],
)
# this is a private library until we can support building the
# test binary
# TODO(mikedanese): fix @io_bazelbuild/rules_go
go_library(
go_test(
name = "go_default_test",
srcs = [
"e2e_test.go",
"metrics_grabber_test.go",
],
library = ":go_default_library",
tags = ["automanaged"],
visibility = ["//visibility:private"],
tags = [
"automanaged",
"integration",
],
deps = [
"//pkg/api/v1:go_default_library",
"//pkg/client/clientset_generated/clientset:go_default_library",
@ -240,6 +240,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(
name = "package-srcs",
srcs = glob(["**"]),