Skip to content

Commit 45f054d

Browse files
Brian DongJames Judd
authored andcommitted
Patch plugin to use local execution by default for test debugging
1 parent 5103b60 commit 45f054d

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

base/src/com/google/idea/blaze/base/command/BlazeFlags.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ public final class BlazeFlags {
4040
// It expands to: --test_arg=--wrapper_script_flag=--debug --test_output=streamed
4141
// --test_strategy=exclusive --test_timeout=9999 --nocache_test_results
4242
public static final String JAVA_TEST_DEBUG = "--java_debug";
43+
// Debugging tests should only run locally, so make sure no remote executor is defined
44+
// while debugging tests
45+
public static final String RUN_LOCALLY = "--remote_executor=";
4346
// Streams stdout/stderr output from each test in real-time.
4447
// Implies --test_strategy=exclusive and --test_sharding_strategy=disabled
4548
public static final String TEST_OUTPUT_STREAMED = "--test_output=streamed";

java/src/com/google/idea/blaze/java/run/BlazeJavaRunProfileState.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ static BlazeCommand.Builder getBlazeCommandBuilder(
286286
}
287287
else {
288288
command.addBlazeFlags(BlazeFlags.JAVA_TEST_DEBUG);
289+
command.addBlazeFlags(BlazeFlags.RUN_LOCALLY);
289290
command.addBlazeFlags(debugPortFlag(true, debugPort));
290291
}
291292
if (kotlinxCoroutinesJavaAgent != null) {

java/tests/unittests/com/google/idea/blaze/java/run/BlazeJavaRunProfileStateTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ public void debugFlagShouldBeIncludedForJavaTest() {
236236
"command",
237237
BlazeFlags.getToolTagFlag(),
238238
"--java_debug",
239+
"--remote_executor=",
239240
"--test_arg=--wrapper_script_flag=--debug=127.0.0.1:5005",
240241
"--",
241242
"//label:rule"));
@@ -263,6 +264,7 @@ public void debugFlagShouldBeIncludedForJavaTestSuite() {
263264
"test",
264265
BlazeFlags.getToolTagFlag(),
265266
"--java_debug",
267+
"--remote_executor=",
266268
"--test_arg=--wrapper_script_flag=--debug=127.0.0.1:5005",
267269
"--",
268270
"//label:java_test_suite_rule"));

0 commit comments

Comments
 (0)