No "run tests" options in simple unit test in project with gradle

Im in a test file, right click, get the context menu -- no option to run unit tests.  Shouldn't I be seeing something here?

I marked the parent directory as a Test Source Root.  

Also, when I use the gradle option to run the program (Jetty web app), and I stop the program, some process is still running that prevents me from restarting in intellij.  I have to drop to a terminal and kill the java process before I run again.

7 comments
Comment actions Permalink

Forgot to mention, and I can't find an edit option for the above post, this is with gradle2 and a fresh intellij13 install.

0
Comment actions Permalink

In case of Gradle project, there should be at least two run configurations options if you run it for the first time (under the "Run" option): one to run the test using IDEA junit runner and other using gradle test task.
See it on the screenshot:
run_test.png

Also, when I use the gradle option to run the program (Jetty web app), and I stop the program, some process is still running that prevents me from restarting in intellij.  I have to drop to a terminal and kill the java process before I run again.

The issue with cancellation of gradle task from IDE described at http://youtrack.jetbrains.com/issue/IDEA-120106

0
Comment actions Permalink

Right,  those run options in your image, under compile, are simply not present for me.

0
Comment actions Permalink

Could you attach a project sample to illustrate the problem?

0
Comment actions Permalink

Unfortunately I cannot attach anything here.  

0
Comment actions Permalink

 

 

I have seen this problem on co-worker's machines over the past year or so, finally it is happening to me. There is simply no option to run as a gradle test any more. In the run history there are still some remembered tests that use gradle.

Is there any way to get more information about why this is happening to help you debug it?

Note that invalidating the cache and restarting doesn't help.

0
Comment actions Permalink

After some stumbling around I found a solution to this in the latest 15.0.3. There is a preference for Build, Execution, Deployment/Gradle/Runner that can be chosen. I hope this helps somebody.

 

 

 

0

Please sign in to leave a comment.