Skip to content

Commit

Permalink
[Skymeld] Request the building of exclusive test targets before seque…
Browse files Browse the repository at this point in the history
…ntially run them later on.

Prior to this CL, we'd only _build_ the exclusive targets sequentially right before running them. This was a deviation from the behavior of non-Skymeld blaze, where these targets are first built in parallel and then run sequentially.

PiperOrigin-RevId: 539645460
Change-Id: I28212b6efca7ea84294aac338ecd4c9340e2f701
  • Loading branch information
joeleba authored and Copybara-Service committed Jun 12, 2023
1 parent 9c91b95 commit c56a1a6
Showing 1 changed file with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
import com.google.devtools.build.skyframe.SkyValue;
import com.google.devtools.build.skyframe.SkyframeLookupResult;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -505,17 +504,16 @@ private void requestConfiguredTargetExecution(
configuredTarget.getProvider(ExtraActionArtifactsProvider.class),
artifactsToBuild,
buildDriverKey.isExtraActionTopLevelOnly());
ImmutableSet.Builder<SkyKey> keysToRequest =
ImmutableSet.<SkyKey>builder().addAll(Artifact.keys(artifactsToBuild.build()));
postEventIfNecessary(postedEventsTypes, env, SomeExecutionStartedEvent.create());
if (testType.equals(NOT_TEST)) {
declareDependenciesAndCheckValues(
env,
Iterables.concat(
Artifact.keys(artifactsToBuild.build()),
Collections.singletonList(
TargetCompletionValue.key(
ConfiguredTargetKey.fromConfiguredTarget(configuredTarget),
topLevelArtifactContext,
false))));
keysToRequest.add(
TargetCompletionValue.key(
ConfiguredTargetKey.fromConfiguredTarget(configuredTarget),
topLevelArtifactContext,
/* willTest= */ false));
declareDependenciesAndCheckValues(env, keysToRequest.build());
return;
}

Expand All @@ -529,20 +527,22 @@ private void requestConfiguredTargetExecution(

if (testType.equals(PARALLEL)) {
// Only run non-exclusive tests here. Exclusive tests need to be run sequentially later.
declareDependenciesAndCheckValues(
env,
Iterables.concat(
artifactsToBuild.build(),
Collections.singletonList(
TestCompletionValue.key(
ConfiguredTargetKey.fromConfiguredTarget(configuredTarget),
topLevelArtifactContext,
/* exclusiveTesting= */ false))));
keysToRequest.add(
TestCompletionValue.key(
ConfiguredTargetKey.fromConfiguredTarget(configuredTarget),
topLevelArtifactContext,
/* exclusiveTesting= */ false));
declareDependenciesAndCheckValues(env, keysToRequest.build());
return;
}

// Exclusive tests will be run with sequential Skyframe evaluations afterwards.
declareDependenciesAndCheckValues(env, artifactsToBuild.build());
keysToRequest.add(
TargetCompletionValue.key(
ConfiguredTargetKey.fromConfiguredTarget(configuredTarget),
topLevelArtifactContext,
/* willTest= */ true));
declareDependenciesAndCheckValues(env, keysToRequest.build());
}

private void announceAspectAnalysisDoneAndRequestExecution(
Expand Down

0 comments on commit c56a1a6

Please sign in to comment.