diff --git a/antlir/bzl/build_defs.bzl b/antlir/bzl/build_defs.bzl index 3e6660b74f..83fedca362 100644 --- a/antlir/bzl/build_defs.bzl +++ b/antlir/bzl/build_defs.bzl @@ -166,6 +166,7 @@ _PYTHON_UNITTEST_KWARGS = _make_rule_kwargs_dict( "tags", "visibility", "supports_static_listing", + "remote_execution", ], ) diff --git a/antlir/vm/bzl/defs.bzl b/antlir/vm/bzl/defs.bzl index 5c58f45e0d..9559861025 100644 --- a/antlir/vm/bzl/defs.bzl +++ b/antlir/vm/bzl/defs.bzl @@ -58,8 +58,6 @@ with the options allowed there. The key differences with load("@bazel_skylib//lib:new_sets.bzl", "sets") load("@bazel_skylib//lib:shell.bzl", "shell") -load("@fbcode_macros//build_defs/lib:re_test_utils.bzl", "re_test_utils") -load("@fbsource//tools/build_defs/buck2:is_buck2.bzl", "is_buck2") load("//antlir/bzl:build_defs.bzl", "add_test_framework_label", "buck_sh_test", "cpp_unittest", "python_unittest", "rust_unittest") load("//antlir/bzl:constants.bzl", "REPO_CFG") load("//antlir/bzl:image_unittest_helpers.bzl", helpers = "image_unittest_helpers") @@ -196,12 +194,6 @@ def _vm_unittest( vm_opts = vm_opts, ) - # NOTE: We could put this code in buck_sh_test itself, but that has much wider impact. - # It's safer to start off just doing a local change for antlir. - re_attrs = {} - if is_buck2(): - re_test_utils.set_re_info(re_attrs, wrapper_labels) - # FIXME: We use a bunch of genrules to generate trampoline scripts that # don't specify their runtime dependencies (because they can't: # https://fburl.com/workplace/ljtl2dv3) To support remote execution of @@ -249,7 +241,7 @@ def _vm_unittest( env = {"BUCK_BASE_BINARY": "$(location :{})".format(actual_test_binary)}, antlir_rule = "user-facing", deps = deps, - **re_attrs + remote_execution = kwargs["remote_execution"] if "remote_execution" in kwargs else None, ) def _vm_cpp_unittest( diff --git a/antlir/vm/tests/BUCK b/antlir/vm/tests/BUCK index a19621e816..8c228114fd 100644 --- a/antlir/vm/tests/BUCK +++ b/antlir/vm/tests/BUCK @@ -1,3 +1,4 @@ +load("@fbcode_macros//build_defs/lib:re_test_utils.bzl", "re_test_utils") load("//antlir/antlir2/bzl/feature:defs.bzl", antlir2_feature = "feature") load("//antlir/antlir2/bzl/image:defs.bzl", antlir2_image = "image") load("//antlir/antlir2/bzl/package:defs.bzl", antlir2_package = "package") @@ -263,11 +264,13 @@ vm.python_unittest( "test_vm_boot.py", ], labels = [ - "supports_remote_execution", - 're_opts_capabilities={"platform":"mtia", "codename":"freya"}', # FIXME(@pdel): Need some more work to get RE test execution for antlir1 vmtests. "disabled", ], + remote_execution = re_test_utils.remote_execution( + codename = "freya", + platform = "mtia", + ), vm_opts = vm.types.opts.new( disk = vm.types.disk.root( layer = ":vmtest-custom-layer",