Refactor test action preparation
Move all deletion / directory creation to prepareFileSystem.
PiperOrigin-RevId: 245374483
diff --git a/src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java b/src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java
index 0483952..2eb8c08 100644
--- a/src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java
+++ b/src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java
@@ -97,7 +97,6 @@
TestRunnerAction action, ActionExecutionContext actionExecutionContext)
throws ExecException, InterruptedException {
Path execRoot = actionExecutionContext.getExecRoot();
- Path coverageDir = execRoot.getRelative(action.getCoverageDirectory());
Path runfilesDir =
getLocalRunfilesDirectory(
action,
@@ -143,7 +142,7 @@
ImmutableList.copyOf(action.getSpawnOutputs()),
localResourceUsage);
return new StandaloneTestRunnerSpawn(
- action, actionExecutionContext, spawn, tmpDir, coverageDir, workingDirectory, execRoot);
+ action, actionExecutionContext, spawn, tmpDir, workingDirectory, execRoot);
}
private StandaloneFailedAttemptResult processFailedTestAttempt(
@@ -454,7 +453,6 @@
private final ActionExecutionContext actionExecutionContext;
private final Spawn spawn;
private final Path tmpDir;
- private final Path coverageDir;
private final Path workingDirectory;
private final Path execRoot;
@@ -463,14 +461,12 @@
ActionExecutionContext actionExecutionContext,
Spawn spawn,
Path tmpDir,
- Path coverageDir,
Path workingDirectory,
Path execRoot) {
this.testAction = testAction;
this.actionExecutionContext = actionExecutionContext;
this.spawn = spawn;
this.tmpDir = tmpDir;
- this.coverageDir = coverageDir;
this.workingDirectory = workingDirectory;
this.execRoot = execRoot;
}
@@ -483,7 +479,7 @@
@Override
public TestAttemptContinuation beginExecution()
throws InterruptedException, IOException, ExecException {
- prepareFileSystem(testAction, tmpDir, coverageDir, workingDirectory);
+ prepareFileSystem(testAction, actionExecutionContext.getExecRoot(), tmpDir, workingDirectory);
return beginTestAttempt(testAction, spawn, actionExecutionContext, execRoot);
}