aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test
diff options
context:
space:
mode:
authorGravatar kush <kush@google.com>2018-07-11 16:21:27 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-07-11 16:22:53 -0700
commit4b120e78f3e0d4142d9ac89f6ef98ef4bc13d0b4 (patch)
tree0453c400d77408aaf7f22d448773c9456a564573 /src/test
parent58158ae7b6bc0b734731c913d3e64946b5a0d111 (diff)
Make the FileArtifactvalue of generated targets available via the FilesetOutputSymlink whenever available.
In this change I'm simply plumbing the FileArtifactValue we requested within RecursiveFilesystemTraversalFunction to the FilesetOutputSymlink. This does not work when the targets are output directories (or symlink to output dirs). The main scenarios this happens is when: 1. Fileset depends on the output dir created by a genrule. 2. Fileset depends on a GoAppengineBinary which creates an output dir. 3. Fileset depends on another Fileset in the non-recommended way (Fileset.entry.files = [<another_fileset>]) instead of the recommended way (FilesetEntry.srcdir = <another_fileset>). RELNOTES: None PiperOrigin-RevId: 204209612
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/com/google/devtools/build/lib/exec/SpawnInputExpanderTest.java3
-rw-r--r--src/test/java/com/google/devtools/build/lib/skyframe/FilesetEntryFunctionTest.java12
2 files changed, 10 insertions, 5 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/exec/SpawnInputExpanderTest.java b/src/test/java/com/google/devtools/build/lib/exec/SpawnInputExpanderTest.java
index 67be7faaf4..e21fdbb4e8 100644
--- a/src/test/java/com/google/devtools/build/lib/exec/SpawnInputExpanderTest.java
+++ b/src/test/java/com/google/devtools/build/lib/exec/SpawnInputExpanderTest.java
@@ -271,7 +271,8 @@ public class SpawnInputExpanderTest {
}
private FilesetOutputSymlink filesetSymlink(String from, String to) {
- return new FilesetOutputSymlink(PathFragment.create(from), PathFragment.create(to));
+ return FilesetOutputSymlink.createForTesting(
+ PathFragment.create(from), PathFragment.create(to));
}
private ImmutableMap<PathFragment, ImmutableList<FilesetOutputSymlink>> simpleFilesetManifest() {
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/FilesetEntryFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/FilesetEntryFunctionTest.java
index fafe4b7717..247b4dca5a 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/FilesetEntryFunctionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/FilesetEntryFunctionTest.java
@@ -192,15 +192,18 @@ public final class FilesetEntryFunctionTest extends FoundationTestCase {
}
private static FilesetOutputSymlink symlink(String from, Artifact to) {
- return new FilesetOutputSymlink(PathFragment.create(from), to.getPath().asFragment());
+ return FilesetOutputSymlink.createForTesting(
+ PathFragment.create(from), to.getPath().asFragment());
}
private static FilesetOutputSymlink symlink(String from, String to) {
- return new FilesetOutputSymlink(PathFragment.create(from), PathFragment.create(to));
+ return FilesetOutputSymlink.createForTesting(
+ PathFragment.create(from), PathFragment.create(to));
}
private static FilesetOutputSymlink symlink(String from, RootedPath to) {
- return new FilesetOutputSymlink(PathFragment.create(from), to.asPath().asFragment());
+ return FilesetOutputSymlink.createForTesting(
+ PathFragment.create(from), to.asPath().asFragment());
}
private void assertSymlinksCreatedInOrder(
@@ -210,7 +213,8 @@ public final class FilesetEntryFunctionTest extends FoundationTestCase {
Collections2.transform(
evalFilesetTraversal(request).getSymlinks(),
// Strip the metadata from the actual results.
- (input) -> new FilesetOutputSymlink(input.name, input.target));
+ (input) ->
+ FilesetOutputSymlink.createForTesting(input.getName(), input.getTargetPath()));
assertThat(actual).containsExactlyElementsIn(expected).inOrder();
}