delete *.bazel files

pull/364/head
Otokaze 5 years ago
parent 642aa3dea5
commit 7241f496d9
  1. 17
      pkg/cache/memcache/main_test.go
  2. 48
      pkg/cache/memcache/test/BUILD.bazel

@ -1,15 +1,13 @@
package memcache package memcache
import ( import (
"flag"
"log" "log"
"os" "os"
"testing" "testing"
"time" "time"
"go-common/library/container/pool" "github.com/bilibili/kratos/pkg/container/pool"
"go-common/library/testing/lich" xtime "github.com/bilibili/kratos/pkg/time"
xtime "go-common/library/time"
) )
var testConnASCII Conn var testConnASCII Conn
@ -70,12 +68,12 @@ func setupTestPool(addr string) {
} }
func TestMain(m *testing.M) { func TestMain(m *testing.M) {
flag.Set("f", "./test/docker-compose.yaml") testMemcacheAddr = os.Getenv("TEST_MEMCACHE_ADDR")
flag.Parse() if testExampleAddr == "" {
if err := lich.Setup(); err != nil { log.Print("TEST_MEMCACHE_ADDR not provide skip test.")
panic(err) // ignored test.
os.Exit(0)
} }
testMemcacheAddr = "127.0.0.1:11211"
setupTestConnASCII(testMemcacheAddr) setupTestConnASCII(testMemcacheAddr)
setupTestMemcache(testMemcacheAddr) setupTestMemcache(testMemcacheAddr)
setupTestPool(testMemcacheAddr) setupTestPool(testMemcacheAddr)
@ -83,6 +81,5 @@ func TestMain(m *testing.M) {
testExampleAddr = testMemcacheAddr testExampleAddr = testMemcacheAddr
ret := m.Run() ret := m.Run()
lich.Teardown()
os.Exit(ret) os.Exit(ret)
} }

@ -1,48 +0,0 @@
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
load(
"@io_bazel_rules_go//proto:def.bzl",
"go_proto_library",
)
go_library(
name = "go_default_library",
srcs = [],
embed = [":proto_go_proto"],
importpath = "go-common/library/cache/memcache/test",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = ["@com_github_golang_protobuf//proto:go_default_library"],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
proto_library(
name = "test_proto",
srcs = ["test.proto"],
import_prefix = "go-common/library/cache/memcache/test",
strip_import_prefix = "",
tags = ["automanaged"],
)
go_proto_library(
name = "proto_go_proto",
compilers = ["@io_bazel_rules_go//proto:go_proto"],
importpath = "go-common/library/cache/memcache/test",
proto = ":test_proto",
tags = ["automanaged"],
)
Loading…
Cancel
Save