|
14 | 14 |
|
15 | 15 | package com.google.devtools.build.lib.analysis.test;
|
16 | 16 |
|
| 17 | +import static com.google.devtools.build.lib.analysis.BaseRuleClasses.TEST_RUNNER_EXEC_GROUP; |
17 | 18 | import static com.google.devtools.build.lib.packages.BuildType.LABEL;
|
18 | 19 |
|
19 | 20 | import com.google.common.base.Preconditions;
|
20 | 21 | import com.google.common.collect.ImmutableList;
|
21 | 22 | import com.google.common.collect.Lists;
|
22 | 23 | import com.google.devtools.build.lib.actions.ActionInput;
|
| 24 | +import com.google.devtools.build.lib.actions.ActionOwner; |
23 | 25 | import com.google.devtools.build.lib.actions.Artifact;
|
24 | 26 | import com.google.devtools.build.lib.actions.ArtifactRoot;
|
25 | 27 | import com.google.devtools.build.lib.actions.RunfilesSupplier;
|
@@ -147,6 +149,11 @@ private boolean isPersistentTestRunner() {
|
147 | 149 | && persistentTestRunnerRunfiles != null;
|
148 | 150 | }
|
149 | 151 |
|
| 152 | + private ActionOwner getOwner() { |
| 153 | + ActionOwner owner = ruleContext.getActionOwner(TEST_RUNNER_EXEC_GROUP); |
| 154 | + return owner == null ? ruleContext.getActionOwner() : owner; |
| 155 | + } |
| 156 | + |
150 | 157 | /**
|
151 | 158 | * Creates a test action and artifacts for the given rule. The test action will use the specified
|
152 | 159 | * executable and runfiles.
|
@@ -403,7 +410,7 @@ private TestParams createTestAction(int shards)
|
403 | 410 | boolean splitCoveragePostProcessing = testConfiguration.splitCoveragePostProcessing();
|
404 | 411 | TestRunnerAction testRunnerAction =
|
405 | 412 | new TestRunnerAction(
|
406 |
| - ruleContext.getActionOwner(), |
| 413 | + getOwner(), |
407 | 414 | inputs,
|
408 | 415 | testRunfilesSupplier,
|
409 | 416 | testActionExecutable,
|
|
0 commit comments