Skip to content

Commit e0ccbd5

Browse files
committed
During test runs, ensure buck uses plain logging.
Occasionally, system properties would mean that Buck running as part of a test run would attempt to use an ANSI console for logging. This makes parsing the output unstable and leads to spurious failures.
1 parent 974cdba commit e0ccbd5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ public Path go() throws IOException {
6767

6868
ImmutableList.Builder<String> builder = ImmutableList.builder();
6969
findBuck(projectRoot, builder);
70-
builder.add("build");
71-
builder.add(target);
70+
builder.add("build", "--config", "color.ui=never", target);
7271

7372
ImmutableList<String> command = builder.build();
7473
CommandLine commandLine = new CommandLine(command.toArray(new String[command.size()]));
@@ -85,7 +84,7 @@ public Path go() throws IOException {
8584
private Path findOutput(Path projectRoot) throws IOException {
8685
ImmutableList.Builder<String> builder = ImmutableList.builder();
8786
findBuck(projectRoot, builder);
88-
builder.add("targets", "--show-output", target);
87+
builder.add("targets", "--show-full-output", "--config", "color.ui=never", target);
8988

9089
ImmutableList<String> command = builder.build();
9190
CommandLine commandLine = new CommandLine(command.toArray(new String[command.size()]));
@@ -96,15 +95,16 @@ private Path findOutput(Path projectRoot) throws IOException {
9695
throw new WebDriverException("Unable to find output! " + target);
9796
}
9897

99-
String[] allLines = commandLine.getStdOut().split(LINE_SEPARATOR.value());
98+
String stdOut = commandLine.getStdOut();
99+
String[] allLines = stdOut.split(LINE_SEPARATOR.value());
100100
String lastLine = null;
101101
for (String line : allLines) {
102102
if (line.startsWith(target)) {
103103
lastLine = line;
104104
break;
105105
}
106106
}
107-
Preconditions.checkNotNull(lastLine);
107+
Preconditions.checkNotNull(lastLine, "Value read: %s", stdOut);
108108

109109
List<String> outputs = Splitter.on(' ').limit(2).splitToList(lastLine);
110110
if (outputs.size() != 2) {

0 commit comments

Comments
 (0)