Bjarne77
Bjarne77

Reputation: 606

Run/Debug it:test from intellij

Does anybody know if it is possible to run and debug activator it:test from intellij? Especially the debugging of the tests would save me a lost of time developing them.

it:test can AFAIK only be run with the activator command, which I cannot call using intellij run configuration.

Upvotes: 1

Views: 301

Answers (1)

Justin Kaeser
Justin Kaeser

Reputation: 5948

You can create an "SBT Task" run configuration from IntelliJ that calls the it:test task. You can run and debug this normally.

Screenshot: Debug/Run Configurations

If you have the setting fork in IntegrationTest := true it is a little more complicated. You will also need to add debug settings to the javaOptions in sbt; for example:

javaOptions += "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"

and in IntelliJ create a Remote run configuration that attaches to the port you configured in sbt:

enter image description here

You can now run the sbt task and then run the remote config for debugging.

Upvotes: 1

Related Questions