Skip to content

Commit b605dd8

Browse files
committed
Work around issue on Windows with BuckBuild in IDE tests
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.
1 parent f10408a commit b605dd8

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

java/client/test/org/openqa/selenium/BuckBuild.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,14 @@ private Path findOutput(Path projectRoot) throws IOException {
9898
}
9999

100100
String[] allLines = commandLine.getStdOut().split(LINE_SEPARATOR.value());
101-
String lastLine = allLines[allLines.length -1 ];
101+
String lastLine = null;
102+
for (String line : allLines) {
103+
if (line.startsWith(target)) {
104+
lastLine = line;
105+
break;
106+
}
107+
}
108+
Preconditions.checkNotNull(lastLine);
102109

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

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

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

0 commit comments

Comments
 (0)