From b3a254d1716cfea3facb34738bc6d4e37651a7f0 Mon Sep 17 00:00:00 2001 From: Ted Kaplan Date: Mon, 27 Feb 2023 09:18:04 -0800 Subject: [PATCH] Add host transition to Java version of py_test (#17594) Co-authored-by: kshyanashree <109167932+kshyanashree@users.noreply.github.com> --- .../build/lib/bazel/rules/python/BazelPyTestRule.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPyTestRule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPyTestRule.java index a58c8eef1416bc..0ebab840205e60 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPyTestRule.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPyTestRule.java @@ -57,7 +57,10 @@ public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env) attr("$launcher", LABEL) .cfg(ExecutionTransitionFactory.create()) .value(env.getToolsLabel("//tools/launcher:launcher"))) - .add(attr(":lcov_merger", LABEL).value(BaseRuleClasses.getCoverageOutputGeneratorLabel())) + .add( + attr(":lcov_merger", LABEL) + .cfg(ExecutionTransitionFactory.create()) + .value(BaseRuleClasses.getCoverageOutputGeneratorLabel())) // Add the script as an attribute in order for py_test to output code coverage results for // code covered by CC binaries invocations. .add(