Add control over the MockAction's shareable state.

MockAction was defaulting shareable status to true and there are instances where we want to test what happens when an action is not shareable. By adding another constructor, we can set whether or not we want MockAction to have shareable state or not.

RELNOTES: None.
PiperOrigin-RevId: 292339019
diff --git a/src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java b/src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java
index 711c826..6d2f8cb 100644
--- a/src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java
+++ b/src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java
@@ -419,18 +419,28 @@
   public static class MockAction extends AbstractAction {
 
     private final boolean middleman;
+    private final boolean isShareable;
 
     public MockAction(Iterable<Artifact> inputs, ImmutableSet<Artifact> outputs) {
-      this(inputs, outputs, /*middleman=*/ false);
+      this(inputs, outputs, /*middleman=*/ false, /*isShareable=*/ true);
     }
 
     public MockAction(
         Iterable<Artifact> inputs, ImmutableSet<Artifact> outputs, boolean middleman) {
+      this(inputs, outputs, middleman, /*isShareable*/ true);
+    }
+
+    public MockAction(
+        Iterable<Artifact> inputs,
+        ImmutableSet<Artifact> outputs,
+        boolean middleman,
+        boolean isShareable) {
       super(
           NULL_ACTION_OWNER,
           NestedSetBuilder.<Artifact>stableOrder().addAll(inputs).build(),
           outputs);
       this.middleman = middleman;
+      this.isShareable = isShareable;
     }
 
     @Override
@@ -452,6 +462,11 @@
     public ActionResult execute(ActionExecutionContext actionExecutionContext) {
       throw new UnsupportedOperationException();
     }
+
+    @Override
+    public boolean isShareable() {
+      return isShareable;
+    }
   }
 
   /**