Skip to content

Commit

Permalink
Merge pull request #3 from lucidsoftware/bdong-fix-debugging-tests-af…
Browse files Browse the repository at this point in the history
…ter-enabling-rbe

Patch plugin to use local execution by default for test debugging
  • Loading branch information
jjudd authored Dec 2, 2024
2 parents 63a9ed1 + 8e3f96c commit 0ec000f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions base/src/com/google/idea/blaze/base/command/BlazeFlags.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public final class BlazeFlags {
// It expands to: --test_arg=--wrapper_script_flag=--debug --test_output=streamed
// --test_strategy=exclusive --test_timeout=9999 --nocache_test_results
public static final String JAVA_TEST_DEBUG = "--java_debug";
// Debugging tests should only run locally, so make sure no remote executor is defined
// while debugging tests
public static final String RUN_LOCALLY = "--remote_executor=";
// Streams stdout/stderr output from each test in real-time.
// Implies --test_strategy=exclusive and --test_sharding_strategy=disabled
public static final String TEST_OUTPUT_STREAMED = "--test_output=streamed";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ static BlazeCommand.Builder getBlazeCommandBuilder(
command.addExeFlags(debugPortFlag(false, debugPort));
} else {
command.addBlazeFlags(BlazeFlags.JAVA_TEST_DEBUG);
command.addBlazeFlags(BlazeFlags.RUN_LOCALLY);
command.addBlazeFlags(debugPortFlag(true, debugPort));
}
if (kotlinxCoroutinesJavaAgent != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ public void debugFlagShouldBeIncludedForJavaTest() {
"command",
BlazeFlags.getToolTagFlag(),
"--java_debug",
"--remote_executor=",
"--test_arg=--wrapper_script_flag=--debug=127.0.0.1:5005",
"--",
"//label:rule"));
Expand Down Expand Up @@ -260,6 +261,7 @@ public void debugFlagShouldBeIncludedForJavaTestSuite() {
"test",
BlazeFlags.getToolTagFlag(),
"--java_debug",
"--remote_executor=",
"--test_arg=--wrapper_script_flag=--debug=127.0.0.1:5005",
"--",
"//label:java_test_suite_rule"));
Expand Down

0 comments on commit 0ec000f

Please sign in to comment.