diff --git a/test/runtimes/BUILD b/test/runtimes/BUILD index ee65cc17d..1f9a6dd40 100644 --- a/test/runtimes/BUILD +++ b/test/runtimes/BUILD @@ -46,4 +46,5 @@ bzl_library( name = "defs_bzl", srcs = ["defs.bzl"], visibility = ["//visibility:private"], + deps = ["//tools:defs_bzl"], ) diff --git a/test/runtimes/defs.bzl b/test/runtimes/defs.bzl index 68143474a..e60f763d0 100644 --- a/test/runtimes/defs.bzl +++ b/test/runtimes/defs.bzl @@ -1,6 +1,6 @@ """Defines a rule for runtime test targets.""" -load("//tools:defs.bzl", "go_test") +load("//tools:defs.bzl", "go_test", "local_test_tags") def _runtime_test_impl(ctx): # Construct arguments. @@ -80,8 +80,7 @@ def runtime_test(name, **kwargs): tags = [ "no-sandbox", "manual", - "notap", - ], + ] + local_test_tags, **kwargs ) diff --git a/tools/bazeldefs/tags.bzl b/tools/bazeldefs/tags.bzl index 80dfc6f2c..f2257c784 100644 --- a/tools/bazeldefs/tags.bzl +++ b/tools/bazeldefs/tags.bzl @@ -59,3 +59,6 @@ generic = [ # combinations, but not so much that it will cause issues. We can probably add # quite a few more variants before this becomes a genuine problem. go_suffixes = explode(explode(archs, oses), generic) + +# Tags for tests that are run locally. +local_test_tags = ["notap"] diff --git a/tools/defs.bzl b/tools/defs.bzl index 10971c9a7..56fc9fc64 100644 --- a/tools/defs.bzl +++ b/tools/defs.bzl @@ -10,7 +10,7 @@ load("//tools/bazeldefs:defs.bzl", _BuildSettingInfo = "BuildSettingInfo", _bool load("//tools/bazeldefs:go.bzl", _gazelle = "gazelle", _go_binary = "go_binary", _go_grpc_and_proto_libraries = "go_grpc_and_proto_libraries", _go_library = "go_library", _go_path = "go_path", _go_proto_library = "go_proto_library", _go_test = "go_test", _gotsan_flag_values = "gotsan_flag_values", _gotsan_values = "gotsan_values", _select_goarch = "select_goarch", _select_goos = "select_goos") load("//tools/bazeldefs:pkg.bzl", _pkg_deb = "pkg_deb", _pkg_tar = "pkg_tar") load("//tools/bazeldefs:platforms.bzl", _default_platform = "default_platform", _platform_capabilities = "platform_capabilities", _platforms = "platforms", _save_restore_platforms = "save_restore_platforms") -load("//tools/bazeldefs:tags.bzl", "go_suffixes") +load("//tools/bazeldefs:tags.bzl", _go_suffixes = "go_suffixes", _local_test_tags = "local_test_tags") load("//tools/go_marshal:defs.bzl", "go_marshal", "marshal_deps", "marshal_test_deps") load("//tools/go_stateify:defs.bzl", "go_stateify") load("//tools/nogo:defs.bzl", "nogo_test") @@ -64,6 +64,9 @@ platforms = _platforms platform_capabilities = _platform_capabilities save_restore_platforms = _save_restore_platforms +# Tags. +local_test_tags = _local_test_tags + def go_binary(name, nogo = True, pure = False, static = False, x_defs = None, **kwargs): """Wraps the standard go_binary. @@ -121,7 +124,7 @@ def calculate_sets(srcs): if not file.endswith(".go"): continue target = "" - for suffix in go_suffixes: + for suffix in _go_suffixes: if file.endswith(suffix + ".go"): target = suffix if not target in result: