aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/test/TestRunnerAction.java
diff options
context:
space:
mode:
authorGravatar Laurent Le Brun <laurentlb@google.com>2016-09-20 12:21:32 +0000
committerGravatar Laszlo Csomor <laszlocsomor@google.com>2016-09-21 07:03:57 +0000
commit08849b29198230eacd4e85fc7246be8e399e4c4d (patch)
tree34190f9efe1a45b922724a81fedfcfa29d14fe51 /src/main/java/com/google/devtools/build/lib/rules/test/TestRunnerAction.java
parent7db6d746f5f973d4a80245d5350b5ca5bfb2a19f (diff)
Description redacted.
-- MOS_MIGRATED_REVID=133693782
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/test/TestRunnerAction.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/test/TestRunnerAction.java32
1 files changed, 13 insertions, 19 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/test/TestRunnerAction.java b/src/main/java/com/google/devtools/build/lib/rules/test/TestRunnerAction.java
index 473ec92069..19bfdb339e 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/test/TestRunnerAction.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/test/TestRunnerAction.java
@@ -80,7 +80,6 @@ public class TestRunnerAction extends AbstractAction implements NotifyOnActionCa
private final PathFragment testStderr;
private final PathFragment testInfrastructureFailure;
private final PathFragment baseDir;
- private final String namePrefix;
private final Artifact coverageData;
private final Artifact microCoverageData;
private final TestTargetProperties testProperties;
@@ -143,29 +142,28 @@ public class TestRunnerAction extends AbstractAction implements NotifyOnActionCa
this.executionSettings = Preconditions.checkNotNull(executionSettings);
this.baseDir = cacheStatus.getExecPath().getParentDirectory();
- this.namePrefix = FileSystemUtils.removeExtension(cacheStatus.getExecPath().getBaseName());
int totalShards = executionSettings.getTotalShards();
Preconditions.checkState((totalShards == 0 && shardNum == 0) ||
(totalShards > 0 && 0 <= shardNum && shardNum < totalShards));
- this.testExitSafe = baseDir.getChild(namePrefix + ".exited_prematurely");
+ this.testExitSafe = baseDir.getChild("test.exited_prematurely");
// testShard Path should be set only if sharding is enabled.
this.testShard = totalShards > 1
- ? baseDir.getChild(namePrefix + ".shard")
+ ? baseDir.getChild("test.shard")
: null;
- this.xmlOutputPath = baseDir.getChild(namePrefix + ".xml");
- this.testWarningsPath = baseDir.getChild(namePrefix + ".warnings");
- this.unusedRunfilesLogPath = baseDir.getChild(namePrefix + ".unused_runfiles_log");
- this.testStderr = baseDir.getChild(namePrefix + ".err");
- this.splitLogsDir = baseDir.getChild(namePrefix + ".raw_splitlogs");
+ this.xmlOutputPath = baseDir.getChild("test.xml");
+ this.testWarningsPath = baseDir.getChild("test.warnings");
+ this.unusedRunfilesLogPath = baseDir.getChild("test.unused_runfiles_log");
+ this.testStderr = baseDir.getChild("test.err");
+ this.splitLogsDir = baseDir.getChild("test.raw_splitlogs");
// See note in {@link #getSplitLogsPath} on the choice of file name.
this.splitLogsPath = splitLogsDir.getChild("test.splitlogs");
- this.undeclaredOutputsDir = baseDir.getChild(namePrefix + ".outputs");
+ this.undeclaredOutputsDir = baseDir.getChild("test.outputs");
this.undeclaredOutputsZipPath = undeclaredOutputsDir.getChild("outputs.zip");
- this.undeclaredOutputsAnnotationsDir = baseDir.getChild(namePrefix + ".outputs_manifest");
+ this.undeclaredOutputsAnnotationsDir = baseDir.getChild("test.outputs_manifest");
this.undeclaredOutputsManifestPath = undeclaredOutputsAnnotationsDir.getChild("MANIFEST");
this.undeclaredOutputsAnnotationsPath = undeclaredOutputsAnnotationsDir.getChild("ANNOTATIONS");
- this.testInfrastructureFailure = baseDir.getChild(namePrefix + ".infrastructure_failure");
+ this.testInfrastructureFailure = baseDir.getChild("test.infrastructure_failure");
this.workspaceName = workspaceName;
Map<String, String> mergedTestEnv = new HashMap<>(configuration.getTestEnv());
@@ -181,10 +179,6 @@ public class TestRunnerAction extends AbstractAction implements NotifyOnActionCa
return baseDir;
}
- public final String getNamePrefix() {
- return namePrefix;
- }
-
@Override
public boolean showsOutputUnconditionally() {
return true;
@@ -336,7 +330,7 @@ public class TestRunnerAction extends AbstractAction implements NotifyOnActionCa
execRoot.getRelative(testInfrastructureFailure).delete();
// Coverage files use "coverage" instead of "test".
- String coveragePrefix = "coverage" + namePrefix.substring(4);
+ String coveragePrefix = "coverage";
// We cannot use coverageData artifact since it may be null. Generate coverage name instead.
execRoot.getRelative(baseDir.getChild(coveragePrefix + ".dat")).delete();
@@ -344,8 +338,8 @@ public class TestRunnerAction extends AbstractAction implements NotifyOnActionCa
execRoot.getRelative(baseDir.getChild(coveragePrefix + ".micro.dat")).delete();
// Delete files fetched from remote execution.
- execRoot.getRelative(baseDir.getChild(namePrefix + ".zip")).delete();
- deleteTestAttemptsDirMaybe(execRoot.getRelative(baseDir), namePrefix);
+ execRoot.getRelative(baseDir.getChild("test.zip")).delete();
+ deleteTestAttemptsDirMaybe(execRoot.getRelative(baseDir), "test");
}
private void deleteTestAttemptsDirMaybe(Path outputDir, String namePrefix) throws IOException {