Skip to content

Commit

Permalink
Work around issue on Windows with BuckBuild in IDE tests
Browse files Browse the repository at this point in the history
Or any system where watchman isn't supported. Turns out
that sometimes the wrong line of output was being
selected to search for the path to the output.
  • Loading branch information
shs96c committed Jun 26, 2016
1 parent f10408a commit b605dd8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions java/client/test/org/openqa/selenium/BuckBuild.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,14 @@ private Path findOutput(Path projectRoot) throws IOException {
}

String[] allLines = commandLine.getStdOut().split(LINE_SEPARATOR.value());
String lastLine = allLines[allLines.length -1 ];
String lastLine = null;
for (String line : allLines) {
if (line.startsWith(target)) {
lastLine = line;
break;
}
}
Preconditions.checkNotNull(lastLine);

List<String> outputs = Splitter.on(' ').limit(2).splitToList(lastLine);
if (outputs.size() != 2) {
Expand Down Expand Up @@ -137,8 +144,7 @@ private void downloadBuckPexIfNecessary(ImmutableList.Builder<String> builder)
Path projectRoot = InProject.locate("Rakefile").getParentFile().toPath();
String buckVersion = new String(Files.readAllBytes(projectRoot.resolve(".buckversion"))).trim();

File rootOfRepo = InProject.locate("Rakefile").getParentFile();
Path pex = rootOfRepo.toPath().resolve("buck-out/crazy-fun/" + buckVersion + "/buck.pex");
Path pex = projectRoot.resolve("buck-out/crazy-fun/" + buckVersion + "/buck.pex");

String expectedHash = new String(Files.readAllBytes(projectRoot.resolve(".buckhash"))).trim();
HashCode md5 = Files.exists(pex) ?
Expand Down

0 comments on commit b605dd8

Please sign in to comment.