How to run all tests in all modules in a folder subtree.
In my project I have a lot of separate modules, each is a Maven project.
I don't have a parent POM.
Most of these Maven projects contain TestNG tests.
These Maven projects are organized in a folder tree, and this tree is beautifully reflected in the Project view, which is important for me.
From inside IntelliJ I would like to be able to automatically run all the tests of all the modules that are under one of these subfolders of the folder tree. The subfolder does not directly contain a module, it contains further subfolders which either contain a module each or contain more subfolders.
I right-click on one of these subfolders and look in the menu for an option like "Run all tests under this subtree" but I don't see anything along these lines.
Is what I'm trying to achieve possible from inside IntelliJ ? Maybe through a plugin ?
For context, I did create a PowerShell script that retrieves all modules under a given subtree and invokes 'mvn test' for all of them, but this has several disadvantages over being able to run the tests from inside IntelliJ, the biggest one being that from inside IntelliJ the tests would run using the actual source code of the dependencies rather than the already compiled versions of the dependencies that it finds in the local Maven repo.
Please sign in to leave a comment.
Hi there,
In your case, it's not possible to run all the tests from a folder subtree because:
In your case you have two options:
If you can provide a minimal sample project, which’ll have the same structure as yours (without a sensitive code), I’ll be able to create a specific feature request on our issue tracker.
You can upload a sample project securely to our server https://uploads.jetbrains.com/ and provide us with the Upload ID. The uploaded data will be accessible only to our team and will be used solely for investigating this issue.
Thank you!
Yes, this is possible in IntelliJ, although there isn't a built-in "run all tests under this folder tree" option. You can create a Compound Run Configuration containing the test configurations for the modules you want and run them together. If the module list changes often, you could automate generating the configuration, but Compound Run Configurations are probably the simplest solution.