Debugging Gradle Tests: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * Gradle Operations =Overview= <syntaxhighlight lang='bash'> gradle test --debug-jvm </syntaxhighlight>...")
 
No edit summary
Line 14: Line 14:
* For selecting specific tests for execution, see https://docs.gradle.org/current/userguide/java_testing.html#simple_name_pattern
* For selecting specific tests for execution, see https://docs.gradle.org/current/userguide/java_testing.html#simple_name_pattern
* Reconcile with [[Testing_with_Gradle_Java_Plugin#Debugging_a_Gradle_Test]]
* Reconcile with [[Testing_with_Gradle_Java_Plugin#Debugging_a_Gradle_Test]]
</font>
<font color=darkgray>Further research is needed:
Start Gradle in debug mode:
</font>
<syntaxhighlight lang='bash'>
./gradlew --no-daemon -Dorg.gradle.debug=true :my-subproject:test
</syntaxhighlight>
<font color=darkgray>It kept starting the daemon, in debug mode, and I could not debug the test. The default port is 5005.</font>
TODO: https://docs.gradle.org/current/userguide/java_testing.html#sec:debugging_java_tests
<font color=darkgray>TODO: reconcile with [[Gradle_Operations#Debug_a_Test_Executed_with_Gradle|Gradle Operations]]</font>.
<font color=darkgray>
When the Gradle daemon is active, this works:
</font>
</font>

Revision as of 22:11, 1 June 2021

Internal

Overview

gradle test --debug-jvm

Gradle will suspend execution right before running tests and wait for debugger connection on port 5005.

TODO:




Further research is needed:

Start Gradle in debug mode:

./gradlew --no-daemon -Dorg.gradle.debug=true :my-subproject:test

It kept starting the daemon, in debug mode, and I could not debug the test. The default port is 5005.

TODO: https://docs.gradle.org/current/userguide/java_testing.html#sec:debugging_java_tests

TODO: reconcile with Gradle Operations.

When the Gradle daemon is active, this works: