Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-34590][TESTS] Allow JDWP debug for tests
### What changes were proposed in this pull request? This PR proposes a new feature that allows developers to debug test code using JDWP with sbt an Maven. More specifically, this PR introduces the following profile options. * `jdwp-test-debug`: An profile which controls enable/disable JDWP debug * `test.jdwp.address`: An option which corresponds to `address` option in JDWP * `test.jdwp.suspend`: An option which corresponds to `suspend` option in JDWP * `test.jdwp.server`: An option which corresponds to `server` option in JDWP * `test.debug.suite`: An option which controls whether debug ScalaStyle suites (Maven only) For `sbt`, this feature can be used like `build/sbt -Pjdwp-test-debug -Dtest.jdwp.address=localhost:9876 -Dtest.jdwp.suspend=y -Dtest.jdwp.server=y` and can be used for both JUnit tests and ScalaTest tests. For `Maven`, this feature can be used like as follows: (For JUnit tests) `build/mvn -Pjdwp-test-debug -Dtest.jdwp.address=localhost:9876 -Dtest.jdwp.suspend=y -Dtest.jdwp.server=y` (For ScalaTest suites) `build/mvn -Pjdwp-test-debug -Dtest.debug.suite=true -Dtest.jdwp.address=localhost:9876 -Dtest.jdwp.suspend=y -Dtest.jdwp.server=y` (It might be useful to specify specific sub-modules like `-pl sql/core,sql/catalyst`). ### Why are the changes needed? It's useful to debug test code. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? I confirmed the following things. * `jdwp-tes-debug` can switch JDWP enabled/disabled * `test.jdwp.address` can change address and port. * `test.jdwp.suspend` can change the behavior that the target debugee suspends or not. * `test.jdwp.server` can change the behavior that the JDWP debugger run as a server or client. * ScalaTest suites can be debugged with Maven with setting `test.debug.suite` to `true`. Closes apache#31706 from sarutak/sbt-jdwp. Authored-by: Kousuke Saruta <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
- Loading branch information