I was experimenting on the command line with the command line that my IDE’s Gradle plugin was using to invoke build tasks… namely debug test file, and debug focused test method.
I noticed on the command line that --debug-jvm works as expected, but -Dtest.debug (or -Dtest.debug=true) seems to have no effect, and the test run does not wait for attachment. It just runs the specified test(s) and exits. I can get around this by configuring the plugin to have the process attach to the waiting debugger. But I’d like us to stay focused on just this use case, on the command line, and not discuss the plugin or any extraneous alternative use cases.
Should the following be true:
C:\GRADLE\gradle-5.0\bin\gradle :cleanTest :test --tests com.me.MyClass* -Dtest.debug
(above does not wait, exits)
C:\GRADLE\gradle-5.0\bin\gradle :cleanTest :test --tests com.me.MyClass* --debug-jvm
(waits for debugger attachment, successfully attaches)
Or is this actually a bug?