IntelliJ: Slow Testing, and Forked Debugging - Grails Daemon?

67 views
Skip to first unread message

Ian Tegebo

unread,
Jun 1, 2015, 12:30:29 PM6/1/15
to gra...@googlegroups.com
It seems that by default the pattern one falls into with IntelliJ and Grails is to launch Grails over and over whilst running tests.  Tiresome though that is, I've not run into issues like I have when I was running Grails outside IntelliJ and variously forgot about that or otherwise seemed to run into file watcher churn.  Looking for other approaches, I found:

http://naleid.com/blog/2014/11/10/debugging-grails-forked-mode
http://joemuraski.blogspot.com/2014/05/speeding-up-feedback-loop-on-grails.html
https://github.com/mjhugo/grails-auto-test
https://objectpartners.com/2014/05/15/automatically-test-your-dirty-grails-classes/

I'm lumping debugging in because I think it's related to the larger issue of managing the interactions between IntellIJ and Grails.

What's the Right Thing?  Not sure, but I suspect it's having IntelliJ manage a Grails daemon to which it submits subsequent requests for "test-app" and the like.

Alternatively, one could create a script that puts Grails in a daemon mode that accepts the interactive commands on a socket - then send requests to that from Run Configurations in IntelliJ; the benefit is that you retain keyboard shortcuts and file:num links (this approach is in contrast to the one above that uses tmux).  So, is this functionality already available?  E.g. "grails interactive --daemon --port 8765".

If not, could someone provide some guidance as to where one might start?  A quick look makes me think one would need to copy and modify GrailsScriptRunner; that approach would probably mean the bin/grails script would need to be updated to point to a different main, i.e. "grails daemon --port 8765" which calls a new GrailsDaemonizedScriptRunner.

Before I go any fruther, it'd be great if someone could sanity check this approach.  Also, FWIW, I'm happy to submit a request to the Jetbrains folks once we sort out the behavior on Grails' side.

Ian Tegebo

unread,
Jun 3, 2015, 11:39:11 AM6/3/15
to gra...@googlegroups.com
Just found out about the Improx Plugin:


It's from 2013, but looks like a good place to start.
Reply all
Reply to author
Forward
0 new messages