Skip to content

Commit

Permalink
Automated rollback of commit c266ac9.
Browse files Browse the repository at this point in the history
*** Reason for rollback ***

Broke Bazel Toolchain on RBE
https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/1743#1dba3b6d-8ea5-4efc-b696-f48e62b035fa

*** Original change description ***

Work towards bazelbuild#12006 Allow exec groups to inherit from the rule or other exec groups

Add a "test" exec group for TestRunnerActions. This will allow users to set {"test.key", "value"} inside their exec properties and {"key", "value"} will propagate as to just TestRunnerActions.

This addresses user request bazelbuild#10799

PiperOrigin-RevId: 340635429
  • Loading branch information
comius authored and copybara-github committed Nov 4, 2020
1 parent 7cc8577 commit c1ae939
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,13 @@ public static LabelLateBoundDefault<BuildConfiguration> getCoverageOutputGenerat
return runUnder != null ? runUnder.getLabel() : null;
});

public static final String TEST_RUNNER_EXEC_GROUP = "test";

/**
* A base rule for all test rules.
*/
public static final class TestBaseRule implements RuleDefinition {
@Override
public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env) {
return builder
.addExecGroup(TEST_RUNNER_EXEC_GROUP)
.requiresConfigurationFragments(TestConfiguration.class)
// TestConfiguration only needed to create TestAction and TestProvider
// Only necessary at top-level and can be skipped if trimmed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@

package com.google.devtools.build.lib.analysis.test;

import static com.google.devtools.build.lib.analysis.BaseRuleClasses.TEST_RUNNER_EXEC_GROUP;
import static com.google.devtools.build.lib.packages.BuildType.LABEL;

import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.google.devtools.build.lib.actions.ActionInput;
import com.google.devtools.build.lib.actions.ActionOwner;
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.actions.ArtifactRoot;
import com.google.devtools.build.lib.actions.RunfilesSupplier;
Expand Down Expand Up @@ -149,11 +147,6 @@ private boolean isPersistentTestRunner() {
&& persistentTestRunnerRunfiles != null;
}

private ActionOwner getOwner() {
ActionOwner owner = ruleContext.getActionOwner(TEST_RUNNER_EXEC_GROUP);
return owner == null ? ruleContext.getActionOwner() : owner;
}

/**
* Creates a test action and artifacts for the given rule. The test action will
* use the specified executable and runfiles.
Expand Down Expand Up @@ -392,7 +385,7 @@ private TestParams createTestAction(int shards) {
boolean splitCoveragePostProcessing = testConfiguration.splitCoveragePostProcessing();
TestRunnerAction testRunnerAction =
new TestRunnerAction(
getOwner(),
ruleContext.getActionOwner(),
inputs,
testRunfilesSupplier,
testActionExecutable,
Expand Down

0 comments on commit c1ae939

Please sign in to comment.