aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/java_tools/junitrunner/java/com/google
diff options
context:
space:
mode:
authorGravatar Kush Chakraborty <kush@google.com>2017-01-10 18:41:28 +0000
committerGravatar Marcel Hlopko <hlopko@google.com>2017-01-10 19:42:40 +0000
commit7d0561b6ca92d72bd8767d4dca50e5437976812c (patch)
tree9e11a748f315c1d756df7ce65c4dc8399951e32d /src/java_tools/junitrunner/java/com/google
parent0910491ef101ac6e9bd23f39ca9abd8c938f0544 (diff)
Rollback changes to the BazelTestRunner which add a dependency on proto3 as it conflicts with IntelliJ dependencies, till we find a better way to separate the dependencies of the Test Runner from the dependencies of the Test Target.
-- PiperOrigin-RevId: 144100298 MOS_MIGRATED_REVID=144100298
Diffstat (limited to 'src/java_tools/junitrunner/java/com/google')
-rw-r--r--src/java_tools/junitrunner/java/com/google/testing/junit/runner/BUILD1
-rw-r--r--src/java_tools/junitrunner/java/com/google/testing/junit/runner/BazelTestRunner.java49
2 files changed, 2 insertions, 48 deletions
diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BUILD b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BUILD
index 71a715a85a..1699cb882b 100644
--- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BUILD
+++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BUILD
@@ -17,7 +17,6 @@ java_library(
"//src/java_tools/junitrunner/java/com/google/testing/junit/runner/model",
"//src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding",
"//src/java_tools/junitrunner/java/com/google/testing/junit/runner/util",
- "//src/main/protobuf:worker_protocol_java_proto",
"//third_party:junit4",
],
)
diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BazelTestRunner.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BazelTestRunner.java
index 7e3984138e..74a6826f88 100644
--- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BazelTestRunner.java
+++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BazelTestRunner.java
@@ -14,16 +14,12 @@
package com.google.testing.junit.runner;
-import com.google.devtools.build.lib.worker.WorkerProtocol.WorkRequest;
-import com.google.devtools.build.lib.worker.WorkerProtocol.WorkResponse;
import com.google.testing.junit.runner.internal.StackTraces;
import com.google.testing.junit.runner.junit4.JUnit4InstanceModules.Config;
import com.google.testing.junit.runner.junit4.JUnit4InstanceModules.SuiteClass;
import com.google.testing.junit.runner.junit4.JUnit4Runner;
import com.google.testing.junit.runner.model.AntXmlResultWriter;
import com.google.testing.junit.runner.model.XmlResultWriter;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
import java.io.PrintStream;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
@@ -77,7 +73,8 @@ public class BazelTestRunner {
String suiteClassName = System.getProperty(TEST_SUITE_PROPERTY_NAME);
if (args.length >= 1 && args[args.length - 1].equals("--persistent_test_runner")) {
- System.exit(runPersistentTestRunner(suiteClassName));
+ System.err.println("Requested test strategy is currently unsupported.");
+ System.exit(1);
}
if (!checkTestSuiteProperty(suiteClassName)) {
@@ -149,48 +146,6 @@ public class BazelTestRunner {
return runner.run().wasSuccessful() ? 0 : 1;
}
- private static int runPersistentTestRunner(String suiteClassName) {
- PrintStream originalStdOut = System.out;
- PrintStream originalStdErr = System.err;
-
- while (true) {
- try {
- WorkRequest request = WorkRequest.parseDelimitedFrom(System.in);
-
- if (request == null) {
- break;
- }
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- PrintStream ps = new PrintStream(baos, true);
- System.setOut(ps);
- System.setErr(ps);
-
- String[] arguments = request.getArgumentsList().toArray(new String[0]);
- int exitCode = -1;
- try {
- exitCode = runTestsInSuite(suiteClassName, arguments);
- } finally {
- System.setOut(originalStdOut);
- System.setErr(originalStdErr);
- }
-
- WorkResponse response =
- WorkResponse
- .newBuilder()
- .setOutput(baos.toString())
- .setExitCode(exitCode)
- .build();
- response.writeDelimitedTo(System.out);
- System.out.flush();
-
- } catch (IOException e) {
- e.printStackTrace();
- return 1;
- }
- }
- return 0;
- }
-
private static Class<?> getTestClass(String name) {
if (name == null) {
return null;