In IntelliJ IDEA when I normally run a unit test I got a dialog that shows me test progress and lets me easily go through the test results. However, I'm using maven for my normal build process and would like to run my unit tests from maven as well. However, when I run my tests from maven instead of with Ideas default "Make" process the "Test Runner Tab" does not appear and I have to manually open the surefire report files in order to find out what went wrong.
So in short "How can I enable the pretty 'Test Runner Tab' for unit test run from a maven build?"
You can run tests using the maven project window in IntelliJ View - Tool Windows - Maven Projects
Then under the project or module you wish to test open the lifecycle goals and click test.
This will run the currently configured test goal. Now the report is logged into the target directory
I use https://github.com/destin/maven-test-support-plugin to view the test results.
You can access this screen once the plugin is installed from the Project window again right click on the projects root and select "Show Test Results" (should be below the maven icon)
Good luck
I recently figured out as close as I think I'll be able to get to an answer. The tests themselves have to be run from intellij-idea. But I can still configure IntelliJ IDEA to run the build via maven first.
As you can see in the Red Highlighted Box I've selected a saved maven build configuration for it to run. So as not to duplicate tests, and keep things simple its a simple mvn package -DskipTests
type build. I'm still curious if the tests are any different having IntelliJ IDEA run them vs the maven-surefire-plugin but now I at least know that the build process is the same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With