108 lines
3.0 KiB
Python
108 lines
3.0 KiB
Python
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
|
|
|
|
go_library(
|
|
name = "util",
|
|
srcs = [
|
|
"cpu_posix.go",
|
|
"cpu_windows.go",
|
|
"errors.go",
|
|
"etcd.go",
|
|
"gogc.go",
|
|
"id_generator.go",
|
|
"misc.go",
|
|
"prefix_helper.go",
|
|
"printer.go",
|
|
"processinfo.go",
|
|
"rlimit_other.go",
|
|
"rlimit_windows.go",
|
|
"security.go",
|
|
"session_pool.go",
|
|
"tokenlimiter.go",
|
|
"urls.go",
|
|
"util.go",
|
|
"wait_group_wrapper.go",
|
|
"worker_pool.go",
|
|
],
|
|
importpath = "github.com/pingcap/tidb/pkg/util",
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"//pkg/config",
|
|
"//pkg/infoschema/context",
|
|
"//pkg/kv",
|
|
"//pkg/meta/model",
|
|
"//pkg/metrics",
|
|
"//pkg/parser",
|
|
"//pkg/parser/auth",
|
|
"//pkg/parser/model",
|
|
"//pkg/parser/mysql",
|
|
"//pkg/parser/terror",
|
|
"//pkg/resourcegroup",
|
|
"//pkg/session/cursor",
|
|
"//pkg/session/txninfo",
|
|
"//pkg/sessionctx/stmtctx",
|
|
"//pkg/util/collate",
|
|
"//pkg/util/disk",
|
|
"//pkg/util/execdetails",
|
|
"//pkg/util/logutil",
|
|
"//pkg/util/memory",
|
|
"//pkg/util/ppcpuusage",
|
|
"//pkg/util/tls",
|
|
"@com_github_ngaut_pools//:pools",
|
|
"@com_github_pingcap_errors//:errors",
|
|
"@com_github_pingcap_failpoint//:failpoint",
|
|
"@com_github_pingcap_log//:log",
|
|
"@com_github_pingcap_tipb//go-tipb",
|
|
"@com_github_tiancaiamao_gp//:gp",
|
|
"@com_github_tikv_client_go_v2//oracle",
|
|
"@io_etcd_go_etcd_client_v3//:client",
|
|
"@io_etcd_go_etcd_client_v3//concurrency",
|
|
"@org_golang_google_grpc//:grpc",
|
|
"@org_golang_x_sync//errgroup",
|
|
"@org_uber_go_atomic//:atomic",
|
|
"@org_uber_go_zap//:zap",
|
|
],
|
|
)
|
|
|
|
go_test(
|
|
name = "util_test",
|
|
timeout = "short",
|
|
srcs = [
|
|
"errors_test.go",
|
|
"main_test.go",
|
|
"misc_test.go",
|
|
"prefix_helper_test.go",
|
|
"processinfo_test.go",
|
|
"security_test.go",
|
|
"session_pool_test.go",
|
|
"urls_test.go",
|
|
"util_test.go",
|
|
"wait_group_wrapper_test.go",
|
|
],
|
|
data = glob(["tls_test/**"]),
|
|
embed = [":util"],
|
|
flaky = True,
|
|
shard_count = 50,
|
|
deps = [
|
|
"//pkg/kv",
|
|
"//pkg/meta/model",
|
|
"//pkg/parser",
|
|
"//pkg/parser/model",
|
|
"//pkg/parser/mysql",
|
|
"//pkg/parser/terror",
|
|
"//pkg/sessionctx",
|
|
"//pkg/sessionctx/stmtctx",
|
|
"//pkg/store/mockstore",
|
|
"//pkg/testkit/testsetup",
|
|
"//pkg/types",
|
|
"//pkg/util/fastrand",
|
|
"//pkg/util/logutil",
|
|
"//pkg/util/memory",
|
|
"@com_github_ngaut_pools//:pools",
|
|
"@com_github_pingcap_errors//:errors",
|
|
"@com_github_stretchr_testify//assert",
|
|
"@com_github_stretchr_testify//require",
|
|
"@org_uber_go_atomic//:atomic",
|
|
"@org_uber_go_goleak//:goleak",
|
|
],
|
|
)
|