Skip to content

Commit

Permalink
last_win_sh_test_experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
jtattermusch committed Oct 12, 2023
1 parent df1976b commit 3914fb5
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 3 deletions.
4 changes: 2 additions & 2 deletions third_party/toolchains/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ platform(
# Inherit from the platform target generated by 'rbe_configs_gen'.
parents = ["//third_party/toolchains/rbe_ubuntu2004/config:platform"],
exec_properties = create_rbe_exec_properties_dict(
docker_add_capabilities = "SYS_PTRACE",
docker_privileged = True,
#docker_add_capabilities = "SYS_PTRACE",
#docker_privileged = True,
# by default, all RBE actions will run on "small" workers.
# For individual targets, this can be overridden by adding the "exec_properties = LARGE_MACHINE"
# attribute.
Expand Down
58 changes: 58 additions & 0 deletions tools/bazelify_tests/build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,61 @@ def grpc_run_simple_command_test(name, args = [], data = [], size = "medium", ti

env = {}
_dockerized_sh_test(name = name, srcs = srcs, args = args, data = data, size = size, timeout = timeout, tags = tags, exec_compatible_with = exec_compatible_with, flaky = flaky, docker_image_version = docker_image_version, env = env, docker_run_as_root = False)


def win_dockerized_sh_test(name, srcs = [], args = [], data = [], size = "medium", timeout = None, tags = [], exec_compatible_with = [], flaky = None, docker_image_version = None, docker_run_as_root = False, env = {}):
"""Runs sh_test under docker either via RBE or via docker sandbox."""
#if docker_image_version:
# image_spec = DOCKERIMAGE_CURRENT_VERSIONS.get(docker_image_version, None)
# if not image_spec:
# fail("Version info for docker image '%s' not found in dockerimage_current_versions.bzl" % docker_image_version)
#else:
# fail("docker_image_version attribute not set for dockerized test '%s'" % name)

exec_properties = create_rbe_exec_properties_dict(
#"container-image": ,
#"OSFamily": "Windows"

#override all the linux values:

labels = {
"os": "windows_2019",
"machine_size": "small"
},
#docker_add_capabilities = "",
#docker_privileged = False,

#labels = {
# "workload": "misc",
# "machine_size": "misc_large",
#},
#docker_network = "standard",
container_image = "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rbe_windows2019@sha256:63aed074a2ca1bf5af45bb43b255d21d51882d7169ec57be7f0f5454ea5d2c98",
os_family = "Windows"
# TODO(jtattermusch): note that docker sandbox doesn't currently support "docker_run_as_root"
#docker_run_as_root = docker_run_as_root,
)

# since the tests require special bazel args, only run them when explicitly requested
tags = ["manual"] + tags

# TODO(jtattermusch): find a way to ensure that action can only run under docker sandbox or remotely
# to avoid running it outside of a docker container by accident.

test_args = {
"name": name,
"srcs": srcs,
"tags": tags,
"args": args,
"flaky": flaky,
"data": data,
"size": size,
"env": env,
"timeout": timeout,
"exec_compatible_with": exec_compatible_with,
"exec_properties": exec_properties,
}

native.sh_test(
**test_args
)
7 changes: 6 additions & 1 deletion tools/bazelify_tests/test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

load("//bazel:grpc_build_system.bzl", "grpc_package")
load("//tools/bazelify_tests:build_defs.bzl", "grpc_run_cpp_distribtest_test", "grpc_run_simple_command_test", "grpc_run_tests_harness_test")
load("//tools/bazelify_tests:build_defs.bzl", "grpc_run_cpp_distribtest_test", "grpc_run_simple_command_test", "grpc_run_tests_harness_test", "win_dockerized_sh_test")
load(":portability_tests.bzl", "generate_run_tests_portability_tests")
load(":bazel_distribtests.bzl", "generate_bazel_distribtests")

Expand Down Expand Up @@ -253,3 +253,8 @@ test_suite(
":portability_tests_linux",
],
)

win_dockerized_sh_test(
name = "win_test",
srcs = [ "win_test.sh" ]
)

0 comments on commit 3914fb5

Please sign in to comment.