diff options
author | tomlu <tomlu@google.com> | 2018-07-04 08:55:42 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-07-04 08:57:40 -0700 |
commit | 2348a75882bda4ed8b983fd4f8af2c45fa292e10 (patch) | |
tree | 50e6b82eb7c4d7ba1556a7696e266b630082e87f /src/main/java/com/google/devtools/build/lib/exec | |
parent | 9b6208c6d74a5d485bed43f4a214f331e32d8ef6 (diff) |
Include more information about build events' referenced local files.
Instead of just a path, events now include information about the type of file (output, source file, stdout/stderr, test logs, etc.). This information can be used by the uploaders to determine a) whether to upload, b) what kind of lease to give the files.
RELNOTES: None
PiperOrigin-RevId: 203285549
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/exec')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/exec/TestAttempt.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/exec/TestAttempt.java b/src/main/java/com/google/devtools/build/lib/exec/TestAttempt.java index 5d2c94a540..ea90ce7863 100644 --- a/src/main/java/com/google/devtools/build/lib/exec/TestAttempt.java +++ b/src/main/java/com/google/devtools/build/lib/exec/TestAttempt.java @@ -17,9 +17,9 @@ package com.google.devtools.build.lib.exec; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableSet; import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.analysis.test.TestRunnerAction; +import com.google.devtools.build.lib.buildeventstream.BuildEvent.LocalFile.LocalFileType; import com.google.devtools.build.lib.buildeventstream.BuildEventContext; import com.google.devtools.build.lib.buildeventstream.BuildEventId; import com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos; @@ -189,12 +189,16 @@ public class TestAttempt implements BuildEventWithOrderConstraint { } @Override - public ImmutableSet<Path> referencedLocalFiles() { - ImmutableSet.Builder<Path> artifacts = ImmutableSet.builder(); + public ImmutableList<LocalFile> referencedLocalFiles() { + LocalFileType localFileType = + status == TestStatus.PASSED + ? LocalFileType.SUCCESSFUL_TEST_OUTPUT + : LocalFileType.FAILED_TEST_OUTPUT; + ImmutableList.Builder<LocalFile> localFiles = ImmutableList.builder(); for (Pair<String, Path> file : files) { - artifacts.add(file.getSecond()); + localFiles.add(new LocalFile(file.getSecond(), localFileType)); } - return artifacts.build(); + return localFiles.build(); } @Override |