aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/ideinfo
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2016-02-15 12:27:10 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2016-02-15 13:44:34 +0000
commita4ba24e286b7e9a7a09e333d8eb64a8cf7e81895 (patch)
treeac7c5f441a15efd3b6dfacae3c5406f95fc10ab4 /src/test/java/com/google/devtools/build/lib/ideinfo
parentdef8ce373cef2c50b8b5be43aea6f56a5a5ba2e1 (diff)
*** Reason for rollback *** Breaks Bazel Build http://ci.bazel.io/job/Bazel/JAVA_VERSION=1.7,PLATFORM_NAME=linux-x86_64/356/console *** Original change description *** Don't include absolute paths in blaze IDE artifacts RELNOTES: Don't include absolute paths in blaze IDE artifacts -- MOS_MIGRATED_REVID=114682419
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/ideinfo')
-rw-r--r--src/test/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspectTest.java40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspectTest.java b/src/test/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspectTest.java
index 22416fc896..6810d5d50d 100644
--- a/src/test/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspectTest.java
+++ b/src/test/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspectTest.java
@@ -43,7 +43,6 @@ import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
-import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -70,10 +69,6 @@ public class AndroidStudioInfoAspectTest extends AndroidStudioInfoAspectTestBase
"//com/google/example:simple", ruleIdeInfos);
if (isNativeTest()) {
assertThat(ruleIdeInfo.getBuildFile()).isEqualTo(buildFilePath.toString());
- ArtifactLocation location = ruleIdeInfo.getBuildFileArtifactLocation();
- assertThat(Paths.get(location.getRootPath(), location.getRelativePath()).toString())
- .isEqualTo(buildFilePath.toString());
- assertThat(location.getRelativePath()).isEqualTo("com/google/example/BUILD");
}
assertThat(ruleIdeInfo.getKind()).isEqualTo(Kind.JAVA_LIBRARY);
assertThat(ruleIdeInfo.getDependenciesCount()).isEqualTo(0);
@@ -912,21 +907,26 @@ public class AndroidStudioInfoAspectTest extends AndroidStudioInfoAspectTestBase
")");
Map<String, RuleIdeInfo> ruleIdeInfos = buildRuleIdeInfo("//com/google/example:lib");
RuleIdeInfo ruleIdeInfo = getRuleInfoAndVerifyLabel("//com/google/example:lib", ruleIdeInfos);
- // todo(dslomov): Skylark aspect implementation does not yet return a correct root path.
- assertThat(ruleIdeInfo.getJavaRuleIdeInfo().getSourcesList()).containsExactly(
- ArtifactLocation.newBuilder()
- .setRootPath(
- isNativeTest() ? targetConfig.getGenfilesDirectory().getPath().getPathString() : "")
- .setRootExecutionPathFragment(
- isNativeTest() ? targetConfig.getGenfilesDirectory().getExecPathString() : "")
- .setRelativePath("com/google/example/gen.java")
- .setIsSource(false)
- .build(),
- ArtifactLocation.newBuilder()
- .setRootPath(isNativeTest() ? directories.getWorkspace().getPathString() : "")
- .setRelativePath("com/google/example/Test.java")
- .setIsSource(true)
- .build());
+ assertThat(ruleIdeInfo.getJavaRuleIdeInfo().getSourcesList())
+ .containsExactly(
+ expectedArtifactLocationWithRootPath(
+ targetConfig.getGenfilesDirectory().getPath().getPathString())
+ .setRelativePath("com/google/example/gen.java")
+ .setIsSource(false)
+ .build(),
+ expectedArtifactLocationWithRootPath(directories.getWorkspace().getPathString())
+ .setRelativePath("com/google/example/Test.java")
+ .setIsSource(true)
+ .build());
+ }
+
+ private ArtifactLocation.Builder expectedArtifactLocationWithRootPath(String pathString) {
+ if (isNativeTest()) {
+ return ArtifactLocation.newBuilder().setRootPath(pathString);
+ } else {
+ // todo(dslomov): Skylark aspect implementation does not yet return a correct root path.
+ return ArtifactLocation.newBuilder();
+ }
}
@Test