i try to debug some tests with intellij.
I have configurated the remote debug as explain in : How to make the debugging in playframework in IntelliJ Idea
And can debug controllers and stuff. When I try to debug tests such as explain in: Is it possible to debug Play! tests from IntelliJ, with a moduled that is located in a sub-folder?
But i recibe the next message:
Action not found
For request 'GET /@tests'
These routes have been tried, in this order:
1GET/controllers.Application.index
2GET/assets/$file<.+>controllers.Assets.at(path:String = "/public", file:String)
3GET/api/crawl/task/begincontrollers.services.crawler.CrawlingService.begin
4GET/api/crawl/task/silk
Any idea what happen here? I'm runing the server in debug mode and run play test, only run the test in console mode. Not as server.
By default, SBT is forking a new process to execute tests. Your IDE is connected to the SBT main process but not to the "forked" one, that's why debugging doesn't work.
You can override this by defining the following setting in your Build.scala file :
val main = play.Project(appName, appVersion, appDependencies).settings(
sbt.Keys.fork in Test := false
)
Now, the main process will be used to execute the tests (when executing test
from the play console) and your IDE should be able to correctly debug them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With