Is there a way to run all test in an root pom and collect test coverage in Intellij Idea ?
Create a Run Configuration that will look for tests in the whole project. Make sure that you choose All in package
and In whole project
in the configurations dialog:
Make sure that you choose the <default>
package in the Choose Package
dialog.
Now you can select to run this configuration using Run 'All in project' with Coverage
:
The result will be presented in a separate coverate window:
And you will also see the result in the Project View
window for a fast overview:
Right click on the parent module (root pom), and select Run 'All Tests' with Coverage
.
pom.xml
and src
sit in. –
Unperforated There is a 'Coverage' plugin, which may not be enabled by default.
Find it at File->Settings->Plugins
.
This will enable the 'Run with Coverage' buttons and menu items.
A short official overview video is here: Code Coverage by IntelliJ IDEA
To expand on ceilfors answer since it has slightly changed.
Right click on the test module -> More Run/Debug
-> Run 'Tests in ...' with Coverage
This is with IntelliJ IDEA 2022.3.2 (Ultimate Edition)
Also the doc shows another way to do it: https://www.jetbrains.com/help/idea/running-test-with-coverage.html
© 2022 - 2024 — McMap. All rights reserved.