aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test
diff options
context:
space:
mode:
authorGravatar brendandouglas <brendandouglas@google.com>2018-06-19 11:31:10 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-06-19 11:32:23 -0700
commitb74922932b25a71c626b47ea9a9afb7dbc506cec (patch)
tree358fd68b19dac04a2b4ff3f0f08f4d96317e8910 /src/test
parent9f4d5fe77be3572e9632601842a62007ccfefef7 (diff)
Add an option to show verbose debugging logs.
Turns out the event handler (BlazeCommandEventHandler) prints almost all event types, and I don't believe there's a way to tune it. We certainly don't want these messages printed to the console unless we're debugging the debugger, so turn them off by default. PiperOrigin-RevId: 201211355
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/com/google/devtools/build/lib/skylarkdebug/server/DebugServerTransportTest.java21
-rw-r--r--src/test/java/com/google/devtools/build/lib/skylarkdebug/server/SkylarkDebugServerTest.java20
2 files changed, 0 insertions, 41 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/skylarkdebug/server/DebugServerTransportTest.java b/src/test/java/com/google/devtools/build/lib/skylarkdebug/server/DebugServerTransportTest.java
index fedf56f690..89a0405cd4 100644
--- a/src/test/java/com/google/devtools/build/lib/skylarkdebug/server/DebugServerTransportTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skylarkdebug/server/DebugServerTransportTest.java
@@ -22,7 +22,6 @@ import com.google.devtools.build.lib.skylarkdebugging.SkylarkDebuggingProtos.Con
import com.google.devtools.build.lib.skylarkdebugging.SkylarkDebuggingProtos.DebugEvent;
import com.google.devtools.build.lib.skylarkdebugging.SkylarkDebuggingProtos.DebugRequest;
import com.google.devtools.build.lib.skylarkdebugging.SkylarkDebuggingProtos.StartDebuggingRequest;
-import com.google.devtools.build.lib.syntax.Environment.FailFastException;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
@@ -30,13 +29,11 @@ import java.net.ServerSocket;
import java.net.Socket;
import java.time.Duration;
import java.util.ArrayList;
-import java.util.EnumSet;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
-import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
@@ -85,24 +82,6 @@ public class DebugServerTransportTest {
}
}
- @Before
- public void setupEventHandler() {
- // fail-fast treats 'debug' messages as errors. Replace with something that doesn't
- events.setFailFast(false);
-
- EnumSet<EventKind> failOnEvents = EnumSet.copyOf(EventKind.ERRORS_AND_WARNINGS);
- failOnEvents.remove(EventKind.DEBUG);
-
- events
- .reporter()
- .addHandler(
- event -> {
- if (failOnEvents.contains(event.getKind())) {
- throw new FailFastException(event.toString());
- }
- });
- }
-
@Test
public void testConnectAndReceiveRequest() throws Exception {
ServerSocket serverSocket = new ServerSocket(0, 1, InetAddress.getByName(null));
diff --git a/src/test/java/com/google/devtools/build/lib/skylarkdebug/server/SkylarkDebugServerTest.java b/src/test/java/com/google/devtools/build/lib/skylarkdebug/server/SkylarkDebugServerTest.java
index f85a24ed8e..ac6a4bb491 100644
--- a/src/test/java/com/google/devtools/build/lib/skylarkdebug/server/SkylarkDebugServerTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skylarkdebug/server/SkylarkDebugServerTest.java
@@ -41,7 +41,6 @@ import com.google.devtools.build.lib.skylarkdebugging.SkylarkDebuggingProtos.Thr
import com.google.devtools.build.lib.syntax.BuildFileAST;
import com.google.devtools.build.lib.syntax.DebugServerUtils;
import com.google.devtools.build.lib.syntax.Environment;
-import com.google.devtools.build.lib.syntax.Environment.FailFastException;
import com.google.devtools.build.lib.syntax.Mutability;
import com.google.devtools.build.lib.syntax.ParserInputSource;
import com.google.devtools.build.lib.syntax.SkylarkList;
@@ -52,7 +51,6 @@ import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.time.Duration;
-import java.util.EnumSet;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
@@ -89,24 +87,6 @@ public class SkylarkDebugServerTest {
DebugServerUtils.initializeDebugServer(server);
}
- @Before
- public void setupEventHandler() {
- // fail-fast treats 'debug' messages as errors. Replace with something that doesn't
- events.setFailFast(false);
-
- EnumSet<EventKind> failOnEvents = EnumSet.copyOf(EventKind.ERRORS_AND_WARNINGS);
- failOnEvents.remove(EventKind.DEBUG);
-
- events
- .reporter()
- .addHandler(
- event -> {
- if (failOnEvents.contains(event.getKind())) {
- throw new FailFastException(event.toString());
- }
- });
- }
-
@After
public void shutDown() throws Exception {
if (client != null) {