diff options
author | Janak Ramakrishnan <janakr@janakr-macbookair2.roam.corp.google.com> | 2016-04-18 00:38:19 +0000 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2016-04-18 10:43:32 +0000 |
commit | fbafe83b65965277e8c8c53b3f4b978b5507e021 (patch) | |
tree | 30b4d1bf1e874a009c2e538f373ff5c8943cfcfe /src/test/java/com/google/devtools/build/lib/pkgcache | |
parent | 4d89d118048a4979a1ff2e69e3e99ffbc2056b14 (diff) |
Tolerate NoSuchPackageException when processing subdirectories.
In RecursiveDirectoryTraversalFunction, we must tolerate
NoSuchPackageException being thrown by subdirectories' nodes, since
that can happen in a nokeep_going build.
--
Change-Id: Id9a48256aa209775f27130186c58e03c788d20a9
Reviewed-on: https://bazel-review.googlesource.com/#/c/3392/5
MOS_MIGRATED_REVID=120081575
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/pkgcache')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/pkgcache/TargetPatternEvaluatorTest.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/pkgcache/TargetPatternEvaluatorTest.java b/src/test/java/com/google/devtools/build/lib/pkgcache/TargetPatternEvaluatorTest.java index dc32181c88..68b9f64a35 100644 --- a/src/test/java/com/google/devtools/build/lib/pkgcache/TargetPatternEvaluatorTest.java +++ b/src/test/java/com/google/devtools/build/lib/pkgcache/TargetPatternEvaluatorTest.java @@ -676,6 +676,21 @@ public class TargetPatternEvaluatorTest extends AbstractTargetPatternEvaluatorTe } } + @Test + public void testSubdirectoryCircularSymlinkNoKeepGoingPrimedParent() throws Exception { + setupSubDirectoryCircularSymlink(); + // We make sure that the parent package is present, so that in the subsequent nokeep_going + // build, the pattern parsing will have as many of its deps available as possible, which + // exercises more code coverage during error bubbling. + assertThat(parseList("//parent:all")).containsExactly(Label.parseAbsolute("//parent:parent")); + try { + parseList("//parent/..."); + fail(); + } catch (TargetParsingException e) { + // Expected. + } + } + /** Regression test for bug: "Bogus 'helpful' error message" */ @Test public void testHelpfulMessageForFileOutsideOfAnyPackage() throws Exception { |