aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--bazel/grpc_build_system.bzl15
-rw-r--r--src/proto/grpc/health/v1/BUILD10
-rw-r--r--src/proto/grpc/lb/v1/BUILD10
-rw-r--r--src/proto/grpc/reflection/v1alpha/BUILD10
-rw-r--r--src/proto/grpc/status/BUILD10
-rw-r--r--src/proto/grpc/testing/BUILD10
-rw-r--r--src/proto/grpc/testing/duplicate/BUILD10
-rw-r--r--test/core/bad_client/BUILD9
-rw-r--r--test/core/bad_ssl/BUILD9
-rw-r--r--test/core/census/BUILD11
-rw-r--r--test/core/channel/BUILD11
-rw-r--r--test/core/client_channel/BUILD11
-rw-r--r--test/core/client_channel/resolvers/BUILD11
-rw-r--r--test/core/compression/BUILD11
-rw-r--r--test/core/end2end/BUILD9
-rw-r--r--test/core/end2end/fuzzers/BUILD11
-rw-r--r--test/core/fling/BUILD11
-rw-r--r--test/core/handshake/BUILD11
-rw-r--r--test/core/http/BUILD11
-rw-r--r--test/core/iomgr/BUILD10
-rw-r--r--test/core/json/BUILD11
-rw-r--r--test/core/nanopb/BUILD11
-rw-r--r--test/core/network_benchmarks/BUILD4
-rw-r--r--test/core/security/BUILD9
-rw-r--r--test/core/slice/BUILD11
-rw-r--r--test/core/support/BUILD9
-rw-r--r--test/core/surface/BUILD9
-rw-r--r--test/core/transport/BUILD9
-rw-r--r--test/core/transport/chttp2/BUILD9
-rw-r--r--test/core/tsi/BUILD9
-rw-r--r--test/core/util/BUILD10
-rw-r--r--test/cpp/codegen/BUILD9
-rw-r--r--test/cpp/common/BUILD9
-rw-r--r--test/cpp/end2end/BUILD10
-rw-r--r--test/cpp/interop/BUILD9
-rw-r--r--test/cpp/microbenchmarks/BUILD9
-rw-r--r--test/cpp/qps/BUILD9
-rw-r--r--test/cpp/server/BUILD4
-rw-r--r--test/cpp/util/BUILD10
39 files changed, 105 insertions, 276 deletions
diff --git a/bazel/grpc_build_system.bzl b/bazel/grpc_build_system.bzl
index 0295adb8ab..bff8988274 100644
--- a/bazel/grpc_build_system.bzl
+++ b/bazel/grpc_build_system.bzl
@@ -105,3 +105,18 @@ def grpc_sh_test(name, srcs, args = [], data = []):
srcs = srcs,
args = args,
data = data)
+
+def grpc_package(name, visibility = "private"):
+ if visibility == "tests":
+ visibility = ["//test:__subpackages__"]
+ elif visibility == "public":
+ visibility = ["//visibility:public"]
+ elif visibility == "private":
+ visibility = []
+ else:
+ fail("Unknown visibility " + visibility)
+
+ if len(visibility) != 0:
+ native.package(
+ default_visibility = visibility
+ )
diff --git a/src/proto/grpc/health/v1/BUILD b/src/proto/grpc/health/v1/BUILD
index 6f6779594b..d234842883 100644
--- a/src/proto/grpc/health/v1/BUILD
+++ b/src/proto/grpc/health/v1/BUILD
@@ -14,15 +14,9 @@
licenses(["notice"]) # Apache v2
-package(
- default_visibility = ["//visibility:public"],
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_package")
-load("//bazel:grpc_build_system.bzl", "grpc_proto_library")
+grpc_package(name = "health", visibility = "public")
grpc_proto_library(
name = "health_proto",
diff --git a/src/proto/grpc/lb/v1/BUILD b/src/proto/grpc/lb/v1/BUILD
index 61b28ee3bb..15bf3c3233 100644
--- a/src/proto/grpc/lb/v1/BUILD
+++ b/src/proto/grpc/lb/v1/BUILD
@@ -14,15 +14,9 @@
licenses(["notice"]) # Apache v2
-package(
- default_visibility = ["//visibility:public"],
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_package")
-load("//bazel:grpc_build_system.bzl", "grpc_proto_library")
+grpc_package(name = "lb", visibility = "public")
grpc_proto_library(
name = "load_balancer_proto",
diff --git a/src/proto/grpc/reflection/v1alpha/BUILD b/src/proto/grpc/reflection/v1alpha/BUILD
index b60784e9d9..4605418447 100644
--- a/src/proto/grpc/reflection/v1alpha/BUILD
+++ b/src/proto/grpc/reflection/v1alpha/BUILD
@@ -14,15 +14,9 @@
licenses(["notice"]) # Apache v2
-package(
- default_visibility = ["//visibility:public"],
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_package")
-load("//bazel:grpc_build_system.bzl", "grpc_proto_library")
+grpc_package(name = "reflection", visibility = "public")
grpc_proto_library(
name = "reflection_proto",
diff --git a/src/proto/grpc/status/BUILD b/src/proto/grpc/status/BUILD
index 61688e5f96..14315d36e3 100644
--- a/src/proto/grpc/status/BUILD
+++ b/src/proto/grpc/status/BUILD
@@ -14,15 +14,9 @@
licenses(["notice"]) # Apache v2
-package(
- default_visibility = ["//visibility:public"],
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_package")
-load("//bazel:grpc_build_system.bzl", "grpc_proto_library")
+grpc_package(name = "status", visibility = "public")
grpc_proto_library(
name = "status_proto",
diff --git a/src/proto/grpc/testing/BUILD b/src/proto/grpc/testing/BUILD
index c8e7d03cb0..07e08117f0 100644
--- a/src/proto/grpc/testing/BUILD
+++ b/src/proto/grpc/testing/BUILD
@@ -14,15 +14,9 @@
licenses(["notice"]) # Apache v2
-package(
- default_visibility = ["//visibility:public"],
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_package")
-load("//bazel:grpc_build_system.bzl", "grpc_proto_library")
+grpc_package(name = "testing", visibility = "public")
grpc_proto_library(
name = "compiler_test_proto",
diff --git a/src/proto/grpc/testing/duplicate/BUILD b/src/proto/grpc/testing/duplicate/BUILD
index 8f91710999..714c9a7518 100644
--- a/src/proto/grpc/testing/duplicate/BUILD
+++ b/src/proto/grpc/testing/duplicate/BUILD
@@ -14,15 +14,9 @@
licenses(["notice"]) # Apache v2
-package(
- default_visibility = ["//visibility:public"],
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_package")
-load("//bazel:grpc_build_system.bzl", "grpc_proto_library")
+grpc_package(name = "duplicate", visibility = "public")
grpc_proto_library(
name = "echo_duplicate_proto",
diff --git a/test/core/bad_client/BUILD b/test/core/bad_client/BUILD
index 8cc9dfa77a..caf2210dca 100644
--- a/test/core/bad_client/BUILD
+++ b/test/core/bad_client/BUILD
@@ -12,14 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+grpc_package(name = "bad_client")
licenses(["notice"]) # Apache v2
diff --git a/test/core/bad_ssl/BUILD b/test/core/bad_ssl/BUILD
index e13d43258a..51210b6dd5 100644
--- a/test/core/bad_ssl/BUILD
+++ b/test/core/bad_ssl/BUILD
@@ -12,14 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+grpc_package(name = "bad_ssl")
licenses(["notice"]) # Apache v2
diff --git a/test/core/census/BUILD b/test/core/census/BUILD
index 988d9a813a..a22ffd1946 100644
--- a/test/core/census/BUILD
+++ b/test/core/census/BUILD
@@ -12,16 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
-licenses(["notice"]) # Apache v2
+grpc_package(name = "census")
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+licenses(["notice"]) # Apache v2
grpc_cc_test(
name = "context_test",
diff --git a/test/core/channel/BUILD b/test/core/channel/BUILD
index 18dd112eb7..d6b1e11cb2 100644
--- a/test/core/channel/BUILD
+++ b/test/core/channel/BUILD
@@ -12,16 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
-licenses(["notice"]) # Apache v2
+grpc_package(name = "core_test_channel")
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+licenses(["notice"]) # Apache v2
grpc_cc_test(
name = "channel_args_test",
diff --git a/test/core/client_channel/BUILD b/test/core/client_channel/BUILD
index 7fc5b977a9..23e258b1f3 100644
--- a/test/core/client_channel/BUILD
+++ b/test/core/client_channel/BUILD
@@ -12,16 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
-licenses(["notice"]) # Apache v2
+grpc_package(name = "core_test_client_channel")
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+licenses(["notice"]) # Apache v2
load("//test/core/util:grpc_fuzzer.bzl", "grpc_fuzzer")
diff --git a/test/core/client_channel/resolvers/BUILD b/test/core/client_channel/resolvers/BUILD
index 8af4a2d5f0..0907e06623 100644
--- a/test/core/client_channel/resolvers/BUILD
+++ b/test/core/client_channel/resolvers/BUILD
@@ -12,16 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
-licenses(["notice"]) # Apache v2
+grpc_package(name = "test/core/client_channel_resolvers")
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+licenses(["notice"]) # Apache v2
grpc_cc_test(
name = "dns_resolver_connectivity_test",
diff --git a/test/core/compression/BUILD b/test/core/compression/BUILD
index e4432b3b9d..1ab6e35f0d 100644
--- a/test/core/compression/BUILD
+++ b/test/core/compression/BUILD
@@ -12,16 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
-licenses(["notice"]) # Apache v2
+grpc_package(name = "test/core/compression")
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+licenses(["notice"]) # Apache v2
grpc_cc_test(
name = "algorithm_test",
diff --git a/test/core/end2end/BUILD b/test/core/end2end/BUILD
index 9e788bf7e5..f1ea4f5b49 100644
--- a/test/core/end2end/BUILD
+++ b/test/core/end2end/BUILD
@@ -12,16 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
licenses(["notice"]) # Apache v2
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+grpc_package(name = "core_end2end", visibility = "private")
load(":generate_tests.bzl", "grpc_end2end_tests")
diff --git a/test/core/end2end/fuzzers/BUILD b/test/core/end2end/fuzzers/BUILD
index bf3a62ad37..c480131497 100644
--- a/test/core/end2end/fuzzers/BUILD
+++ b/test/core/end2end/fuzzers/BUILD
@@ -12,16 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
-licenses(["notice"]) # Apache v2
+grpc_package(name = "core_end2end_fuzzers")
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+licenses(["notice"]) # Apache v2
load("//test/core/util:grpc_fuzzer.bzl", "grpc_fuzzer")
diff --git a/test/core/fling/BUILD b/test/core/fling/BUILD
index b0d34e9eb0..27b2b5bec6 100644
--- a/test/core/fling/BUILD
+++ b/test/core/fling/BUILD
@@ -12,16 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
-licenses(["notice"]) # Apache v2
+grpc_package(name = "test/core/fling")
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+licenses(["notice"]) # Apache v2
load("//test/core/util:grpc_fuzzer.bzl", "grpc_fuzzer")
diff --git a/test/core/handshake/BUILD b/test/core/handshake/BUILD
index c93ddc8c21..8e462cfc5b 100644
--- a/test/core/handshake/BUILD
+++ b/test/core/handshake/BUILD
@@ -12,16 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
-licenses(["notice"]) # Apache v2
+grpc_package(name = "test/core/handshake")
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+licenses(["notice"]) # Apache v2
grpc_cc_test(
name = "client_ssl",
diff --git a/test/core/http/BUILD b/test/core/http/BUILD
index 28313082c6..fffdac5e08 100644
--- a/test/core/http/BUILD
+++ b/test/core/http/BUILD
@@ -12,16 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
-licenses(["notice"]) # Apache v2
+grpc_package(name = "test/core/http")
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+licenses(["notice"]) # Apache v2
load("//test/core/util:grpc_fuzzer.bzl", "grpc_fuzzer")
diff --git a/test/core/iomgr/BUILD b/test/core/iomgr/BUILD
index 3e6fd37ec6..7620d1de21 100644
--- a/test/core/iomgr/BUILD
+++ b/test/core/iomgr/BUILD
@@ -12,19 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
licenses(["notice"]) # Apache v2
load("//test/core/util:grpc_fuzzer.bzl", "grpc_fuzzer")
-package(
- default_visibility = ["//visibility:public"], # Useful for third party devs to test their io manager implementation.
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+grpc_package(name = "test/core/iomgr", visibility = "public") # Useful for third party devs to test their io manager implementation.
grpc_cc_library(
name = "endpoint_tests",
diff --git a/test/core/json/BUILD b/test/core/json/BUILD
index 36b0897d80..3ff7918677 100644
--- a/test/core/json/BUILD
+++ b/test/core/json/BUILD
@@ -12,16 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
-licenses(["notice"]) # Apache v2
+grpc_package(name = "test/core/json")
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+licenses(["notice"]) # Apache v2
load("//test/core/util:grpc_fuzzer.bzl", "grpc_fuzzer")
diff --git a/test/core/nanopb/BUILD b/test/core/nanopb/BUILD
index bdb468867d..f332207e2d 100644
--- a/test/core/nanopb/BUILD
+++ b/test/core/nanopb/BUILD
@@ -12,16 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
-licenses(["notice"]) # Apache v2
+grpc_package(name = "test/core/nanopb")
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+licenses(["notice"]) # Apache v2
load("//test/core/util:grpc_fuzzer.bzl", "grpc_fuzzer")
diff --git a/test/core/network_benchmarks/BUILD b/test/core/network_benchmarks/BUILD
index cee23ecd51..dd0c75c9d1 100644
--- a/test/core/network_benchmarks/BUILD
+++ b/test/core/network_benchmarks/BUILD
@@ -12,7 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
+
+grpc_package(name = "test/core/network_benchmarks")
licenses(["notice"]) # Apache v2
diff --git a/test/core/security/BUILD b/test/core/security/BUILD
index 241ffc0591..dc41759922 100644
--- a/test/core/security/BUILD
+++ b/test/core/security/BUILD
@@ -12,16 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
licenses(["notice"]) # Apache v2
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+grpc_package(name = "test/core/security")
load("//test/core/util:grpc_fuzzer.bzl", "grpc_fuzzer")
diff --git a/test/core/slice/BUILD b/test/core/slice/BUILD
index 9f2225adfb..f86a3a6082 100644
--- a/test/core/slice/BUILD
+++ b/test/core/slice/BUILD
@@ -12,16 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
-licenses(["notice"]) # Apache v2
+grpc_package(name = "test/core/slice")
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+licenses(["notice"]) # Apache v2
load("//test/core/util:grpc_fuzzer.bzl", "grpc_fuzzer")
diff --git a/test/core/support/BUILD b/test/core/support/BUILD
index 7e142c1e3f..096576e13c 100644
--- a/test/core/support/BUILD
+++ b/test/core/support/BUILD
@@ -12,16 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
licenses(["notice"]) # Apache v2
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+grpc_package(name = "test/core/support")
grpc_cc_test(
name = "alloc_test",
diff --git a/test/core/surface/BUILD b/test/core/surface/BUILD
index 2923927412..17db7737f7 100644
--- a/test/core/surface/BUILD
+++ b/test/core/surface/BUILD
@@ -12,16 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
licenses(["notice"]) # Apache v2
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+grpc_package(name = "test/core/surface")
grpc_cc_test(
name = "alarm_test",
diff --git a/test/core/transport/BUILD b/test/core/transport/BUILD
index 040c0c35c2..12e36132c8 100644
--- a/test/core/transport/BUILD
+++ b/test/core/transport/BUILD
@@ -12,16 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
licenses(["notice"]) # Apache v2
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+grpc_package(name = "test/core/transport")
grpc_cc_test(
name = "bdp_estimator_test",
diff --git a/test/core/transport/chttp2/BUILD b/test/core/transport/chttp2/BUILD
index e3989f7059..6081940243 100644
--- a/test/core/transport/chttp2/BUILD
+++ b/test/core/transport/chttp2/BUILD
@@ -12,16 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
licenses(["notice"]) # Apache v2
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+grpc_package(name = "test/core/transport/chttp2")
load("//test/core/util:grpc_fuzzer.bzl", "grpc_fuzzer")
diff --git a/test/core/tsi/BUILD b/test/core/tsi/BUILD
index 3bbc50b27e..82e0e5fb80 100644
--- a/test/core/tsi/BUILD
+++ b/test/core/tsi/BUILD
@@ -12,16 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
licenses(["notice"]) # Apache v2
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+grpc_package(name = "test/core/tsi")
grpc_cc_test(
name = "transport_security_test",
diff --git a/test/core/util/BUILD b/test/core/util/BUILD
index 1268c2cd10..09c006dba8 100644
--- a/test/core/util/BUILD
+++ b/test/core/util/BUILD
@@ -12,17 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
licenses(["notice"]) # Apache v2
-package(
- default_visibility = ["//visibility:public"],
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+grpc_package(name = "core_test_util", visibility = "public")
grpc_cc_library(
name = "gpr_test_util",
diff --git a/test/cpp/codegen/BUILD b/test/cpp/codegen/BUILD
index 4780800645..8de46be816 100644
--- a/test/cpp/codegen/BUILD
+++ b/test/cpp/codegen/BUILD
@@ -14,14 +14,9 @@
licenses(["notice"]) # Apache v2
-load("//bazel:grpc_build_system.bzl", "grpc_cc_test")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_package")
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+grpc_package(name = "test/cpp/codegen")
grpc_cc_test(
name = "codegen_test_full",
diff --git a/test/cpp/common/BUILD b/test/cpp/common/BUILD
index be9c279f13..e2b6365b13 100644
--- a/test/cpp/common/BUILD
+++ b/test/cpp/common/BUILD
@@ -14,14 +14,9 @@
licenses(["notice"]) # Apache v2
-load("//bazel:grpc_build_system.bzl", "grpc_cc_test")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_package")
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+grpc_package(name = "test/cpp/common")
grpc_cc_test(
name = "alarm_cpp_test",
diff --git a/test/cpp/end2end/BUILD b/test/cpp/end2end/BUILD
index 27c5492c17..b8505c1ae7 100644
--- a/test/cpp/end2end/BUILD
+++ b/test/cpp/end2end/BUILD
@@ -14,15 +14,9 @@
licenses(["notice"]) # Apache v2
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_package")
-package(
- default_visibility=["//visibility:public"], # Allows external users to implement end2end tests.
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+grpc_package(name = "test/cpp/end2end", visibility = "public") # Allows external users to implement end2end tests.
grpc_cc_library(
name = "test_service_impl",
diff --git a/test/cpp/interop/BUILD b/test/cpp/interop/BUILD
index 9123bd929e..4f21551ff4 100644
--- a/test/cpp/interop/BUILD
+++ b/test/cpp/interop/BUILD
@@ -14,14 +14,9 @@
licenses(["notice"]) # Apache v2
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+grpc_package(name = "test/cpp/interop")
grpc_cc_library(
name = "server_helper_lib",
diff --git a/test/cpp/microbenchmarks/BUILD b/test/cpp/microbenchmarks/BUILD
index 442da38426..5ad9eb6872 100644
--- a/test/cpp/microbenchmarks/BUILD
+++ b/test/cpp/microbenchmarks/BUILD
@@ -14,14 +14,9 @@
licenses(["notice"]) # Apache v2
-load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_cc_library")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_cc_library", "grpc_package")
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+grpc_package(name = "test/cpp/microbenchmarks")
grpc_cc_test(
name = "noop-benchmark",
diff --git a/test/cpp/qps/BUILD b/test/cpp/qps/BUILD
index b3348b76fa..31f210dec0 100644
--- a/test/cpp/qps/BUILD
+++ b/test/cpp/qps/BUILD
@@ -14,14 +14,9 @@
licenses(["notice"]) # Apache v2
-load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_cc_library", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_cc_library", "grpc_cc_binary", "grpc_package")
-package(
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+grpc_package(name = "test/cpp/qps")
grpc_cc_library(
name = "parse_json",
diff --git a/test/cpp/server/BUILD b/test/cpp/server/BUILD
index 3f63be2aa3..7538845803 100644
--- a/test/cpp/server/BUILD
+++ b/test/cpp/server/BUILD
@@ -14,7 +14,9 @@
licenses(["notice"]) # Apache v2
-load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_cc_library", "grpc_cc_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_cc_library", "grpc_cc_binary", "grpc_package")
+
+grpc_package(name = "test/cpp/server")
grpc_cc_test(
name = "server_builder_test",
diff --git a/test/cpp/util/BUILD b/test/cpp/util/BUILD
index fbdec05698..2559c18c32 100644
--- a/test/cpp/util/BUILD
+++ b/test/cpp/util/BUILD
@@ -14,15 +14,9 @@
licenses(["notice"]) # Apache v2
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_binary", "grpc_cc_test")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_binary", "grpc_cc_test", "grpc_package")
-package(
- default_visibility = ["//visibility:public"],
- features = [
- "-layering_check",
- "-parse_headers",
- ],
-)
+grpc_package(name = "test/cpp/util", visibility = "public")
grpc_cc_library(
name = "test_config",