Enable the `test` command with merged Skyframe phases.

This CL focuses on getting the bare minimum of the command working, without consideration for incremental state. There's also still no support yet for exclusive tests (due to no local actions) or skipping targets.

PiperOrigin-RevId: 434723812
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/BuildDriverKey.java b/src/main/java/com/google/devtools/build/lib/skyframe/BuildDriverKey.java
index 1f99e87..94ef0c1 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/BuildDriverKey.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/BuildDriverKey.java
@@ -23,18 +23,32 @@
  * Wraps an {@link ActionLookupKey}. The evaluation of this SkyKey is the entry point of analyzing
  * the {@link ActionLookupKey} and executing the associated actions.
  */
-public class BuildDriverKey implements SkyKey {
+public final class BuildDriverKey implements SkyKey {
   private final ActionLookupKey actionLookupKey;
   private final TopLevelArtifactContext topLevelArtifactContext;
+  private final TestType testType;
   private final boolean strictActionConflictCheck;
 
   public BuildDriverKey(
       ActionLookupKey actionLookupKey,
       TopLevelArtifactContext topLevelArtifactContext,
       boolean strictActionConflictCheck) {
+    this(
+        actionLookupKey,
+        topLevelArtifactContext,
+        strictActionConflictCheck,
+        /*testType=*/ TestType.NOT_TEST);
+  }
+
+  public BuildDriverKey(
+      ActionLookupKey actionLookupKey,
+      TopLevelArtifactContext topLevelArtifactContext,
+      boolean strictActionConflictCheck,
+      TestType testType) {
     this.actionLookupKey = actionLookupKey;
     this.topLevelArtifactContext = topLevelArtifactContext;
     this.strictActionConflictCheck = strictActionConflictCheck;
+    this.testType = testType;
   }
 
   public TopLevelArtifactContext getTopLevelArtifactContext() {
@@ -45,6 +59,14 @@
     return actionLookupKey;
   }
 
+  public boolean isTest() {
+    return TestType.NOT_TEST.equals(testType);
+  }
+
+  public TestType getTestType() {
+    return testType;
+  }
+
   public boolean strictActionConflictCheck() {
     return strictActionConflictCheck;
   }
@@ -68,4 +90,15 @@
   public int hashCode() {
     return Objects.hash(actionLookupKey, topLevelArtifactContext);
   }
+
+  @Override
+  public final String toString() {
+    return String.format("ActionLookupKey: %s; TestType: %s", actionLookupKey, testType);
+  }
+
+  enum TestType {
+    NOT_TEST,
+    PARALLEL,
+    EXCLUSIVE
+  }
 }