How can I run all tests from two or more IDEA modules at once?
I'm using many modules and it is important to run all of the unit tests often and when I choose more than one folder to run, there's no 'run' option on the context menu any more.
How can I run all tests from two or more IDEA modules at once?
I'm using many modules and it is important to run all of the unit tests often and when I choose more than one folder to run, there's no 'run' option on the context menu any more.
Select all modules, right-click them and choose to run all tests. This will create a configuration called "Whole Project" which you can run again at any time.
I found this better than the accepted answer because this runs the unit tests separately for each module. If your test cases use module-specific resources during its run-time then the accepted answer's best way won't work.
Select all modules

Right click and choose to run all tests

Get a new run configuration

This worked for me for a project with multiple modules.
Create a new JUnit run/debug configuration. Test kind: 'All in package' Search for tests: 'Whole project'
You will have to specify a working directory as well.
If you use Gradle and have multiple modules, you can do it that way:
Settings/Build, Execution, Deployment/Build Tools/Gradle -> Run tests using: Gradle)Run test in [module name]Edit Configurations...:foo:test :bar:test :baz:test --tests *Test Foo + Bar + BazNow you can just run the configuration to perform the tests you need.