|
|
|
@ -29,8 +29,8 @@ Contains macros used throughout the repo. |
|
|
|
|
|
|
|
|
|
load("//bazel:cc_grpc_library.bzl", "cc_grpc_library") |
|
|
|
|
load("//bazel:copts.bzl", "GRPC_DEFAULT_COPTS") |
|
|
|
|
load("//bazel:experiments.bzl", "EXPERIMENTS", "EXPERIMENT_ENABLES") |
|
|
|
|
load("//bazel:test_experiments.bzl", "TEST_EXPERIMENTS", "TEST_EXPERIMENT_ENABLES") |
|
|
|
|
load("//bazel:experiments.bzl", "EXPERIMENTS", "EXPERIMENT_ENABLES", "EXPERIMENT_POLLERS") |
|
|
|
|
load("//bazel:test_experiments.bzl", "TEST_EXPERIMENTS", "TEST_EXPERIMENT_ENABLES", "TEST_EXPERIMENT_POLLERS") |
|
|
|
|
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_unit_test") |
|
|
|
|
load("@build_bazel_rules_apple//apple/testing/default_runner:ios_test_runner.bzl", "ios_test_runner") |
|
|
|
|
load("@com_google_protobuf//bazel:upb_proto_library.bzl", "upb_proto_library", "upb_proto_reflection_library") |
|
|
|
@ -279,8 +279,10 @@ def ios_cc_test( |
|
|
|
|
deps = ios_test_deps, |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
def expand_tests(name, srcs, deps, tags, args, exclude_pollers, uses_polling, uses_event_engine, flaky): |
|
|
|
|
"""Common logic used to parameterize tests for every poller and EventEngine and experiment. |
|
|
|
|
def expand_poller_config(name, srcs, deps, tags, args, exclude_pollers, uses_polling, uses_event_engine, flaky): |
|
|
|
|
"""Common logic used to parameterize tests for every poller and EventEngine. |
|
|
|
|
|
|
|
|
|
Used by expand_tests (repeatedly) to form base lists of pollers for each experiment. |
|
|
|
|
|
|
|
|
|
Args: |
|
|
|
|
name: base name of the test |
|
|
|
@ -297,6 +299,7 @@ def expand_tests(name, srcs, deps, tags, args, exclude_pollers, uses_polling, us |
|
|
|
|
Returns: |
|
|
|
|
A list of dictionaries containing modified values of name, srcs, deps, tags, and args. |
|
|
|
|
""" |
|
|
|
|
|
|
|
|
|
poller_config = [] |
|
|
|
|
|
|
|
|
|
# See work_stealing_thread_pool.cc for details. |
|
|
|
@ -373,6 +376,27 @@ def expand_tests(name, srcs, deps, tags, args, exclude_pollers, uses_polling, us |
|
|
|
|
"flaky": flaky, |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
return poller_config |
|
|
|
|
|
|
|
|
|
def expand_tests(name, srcs, deps, tags, args, exclude_pollers, uses_polling, uses_event_engine, flaky): |
|
|
|
|
"""Common logic used to parameterize tests for every poller and EventEngine and experiment. |
|
|
|
|
|
|
|
|
|
Args: |
|
|
|
|
name: base name of the test |
|
|
|
|
srcs: source files |
|
|
|
|
deps: base deps |
|
|
|
|
tags: base tags |
|
|
|
|
args: base args |
|
|
|
|
flaky: base flaky |
|
|
|
|
exclude_pollers: list of poller names to exclude for this set of tests. |
|
|
|
|
uses_polling: set to False if the test is not sensitive to polling methodology. |
|
|
|
|
uses_event_engine: set to False if the test is not sensitive to |
|
|
|
|
EventEngine implementation differences |
|
|
|
|
|
|
|
|
|
Returns: |
|
|
|
|
A list of dictionaries containing modified values of name, srcs, deps, tags, and args. |
|
|
|
|
""" |
|
|
|
|
|
|
|
|
|
experiments = {} |
|
|
|
|
|
|
|
|
|
# buildifier: disable=uninitialized |
|
|
|
@ -421,13 +445,28 @@ def expand_tests(name, srcs, deps, tags, args, exclude_pollers, uses_polling, us |
|
|
|
|
tags.append("no_test_ios") |
|
|
|
|
return tags |
|
|
|
|
|
|
|
|
|
experiment_config = list(poller_config) |
|
|
|
|
base_params = { |
|
|
|
|
"name": name, |
|
|
|
|
"srcs": srcs, |
|
|
|
|
"deps": deps, |
|
|
|
|
"tags": tags, |
|
|
|
|
"args": args, |
|
|
|
|
"exclude_pollers": exclude_pollers, |
|
|
|
|
"uses_polling": uses_polling, |
|
|
|
|
"uses_event_engine": uses_event_engine, |
|
|
|
|
"flaky": flaky, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
experiment_config = expand_poller_config(**base_params) |
|
|
|
|
experiment_enables = {k: v for k, v in EXPERIMENT_ENABLES.items() + TEST_EXPERIMENT_ENABLES.items()} |
|
|
|
|
experiment_pollers = EXPERIMENT_POLLERS + TEST_EXPERIMENT_POLLERS |
|
|
|
|
for mode, config in mode_config.items(): |
|
|
|
|
enabled_tags, disabled_tags = config |
|
|
|
|
if enabled_tags != None: |
|
|
|
|
for experiment in experiments[mode].keys(): |
|
|
|
|
for config in poller_config: |
|
|
|
|
experiment_params = dict(base_params) |
|
|
|
|
experiment_params["uses_polling"] = uses_polling and (experiment in experiment_pollers) |
|
|
|
|
for config in expand_poller_config(**experiment_params): |
|
|
|
|
config = dict(config) |
|
|
|
|
config["name"] = config["name"] + "@experiment=" + experiment |
|
|
|
|
env = dict(config["env"]) |
|
|
|
@ -443,7 +482,9 @@ def expand_tests(name, srcs, deps, tags, args, exclude_pollers, uses_polling, us |
|
|
|
|
experiment_config.append(config) |
|
|
|
|
if disabled_tags != None: |
|
|
|
|
for experiment in experiments[mode].keys(): |
|
|
|
|
for config in poller_config: |
|
|
|
|
experiment_params = dict(base_params) |
|
|
|
|
experiment_params["uses_polling"] = uses_polling and (experiment in experiment_pollers) |
|
|
|
|
for config in expand_poller_config(**experiment_params): |
|
|
|
|
config = dict(config) |
|
|
|
|
config["name"] = config["name"] + "@experiment=no_" + experiment |
|
|
|
|
env = dict(config["env"]) |
|
|
|
|