8.1.3 : right click on package > Run tests doesn't select the right classpath

if you currently have a run configuration selected, it seems that configuration's classpath will be used to look for the unit tests, resulting in IDEA saying that no unit tests are found.

If I then change the current run config classapth to give it the module containing the package i'm currently trying to run tests for, it works fine

4 comments
Comment actions Permalink

Hello Thibaut,

The classpath is taken from the default JUnit or TestNG configuration (see
"Edit Defaults" button in "Run/Debug Configurations" dialog). If you specified
any module there, it will be used. If not, the module of the file you're
trying to run will be used.

if you currently have a run configuration selected, it seems that
configuration's classpath will be used to look for the unit tests,
resulting in IDEA saying that no unit tests are found.

If I then change the current run config classapth to give it the
module containing the package i'm currently trying to run tests for,
it works fine


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Hi Dmitry,

This is true when running a specific class, but doesn't seem true when running all tests of a package, by right cliking on that package.

0
Comment actions Permalink

Hello Thibaut,

Please check the scope for tests: all in project, in module or module with
dependencies

Thank you
-


Anna Kozlova
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

Hi Dmitry,

This is true when running a specific class, but doesn't seem true when
running all tests of a package, by right cliking on that package.

---
Original message URL:
http://www.jetbrains.net/devnet/message/5241100#5241100



0
Comment actions Permalink

seems I'm not clear enough

The scenario I'm talking about is as follows :
- use a multi module project with tests in several modules
- first execute whatever tests you want from one of the modules, which will result in the creation of a temporary run configuration. This works fine, and the created temp Run Config is correctly configured.
- then, try to run all tests of a package (by right clicking on the package in project tool window), FROM A DIFFERENT MODULE. This does not work, it seems the same run configuration is reused, but not adjusted to use the adequate settings and classpath.

The only work around I have, is deleting the previously created run config, then execute the tests of the package i'm interested in

edit : actually it's still more complicated : when i delete all the run configs, it still does not do what i want : i have multiple modules contributing subpackages to a common parent package. When i right click on the parent package in a module subtree, the module classpath chosen is not always the good one, it may be one of the other modules contributing classes in the same parent package.

0

Please sign in to leave a comment.