如何查看IntelliJ IDEA“测试运行器选项卡”?从maven运行测试时? [英] How can I view the IntelliJ IDEA "Test Runner Tab" when running tests from maven?

查看:685
本文介绍了如何查看IntelliJ IDEA“测试运行器选项卡”?从maven运行测试时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在IntelliJ IDEA中,当我正常运行单元测试时,我得到一个对话框,显示测试进度并让我轻松浏览测试结果。但是,我正在使用maven进行正常的构建过程,并希望从maven运行我的单元测试。但是,当我从maven而不是使用Ideas默认Make进程运行我的测试时,Test Runner Tab不会出现,我必须手动打开surefire报告文件以找出问题所在。

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.

所以简而言之如何从maven构建中为单元测试运行启用漂亮的'Test Runner Tab'?

So in short "How can I enable the pretty 'Test Runner Tab' for unit test run from a maven build?"

推荐答案

我最近发现我认为我能够得到答案。测试本身必须从。但我仍然可以配置 IntelliJ IDEA 来首先通过 maven 运行构建。

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 . But I can still configure IntelliJ IDEA to run the build via maven first.

正如您在红色突出显示的框中看到的那样''我们选择了一个已保存的maven构建配置来运行它。为了不重复测试,并保持简单,它是一个简单的 mvn包-DskipTests 类型构建。我仍然很好奇,如果测试有任何不同, IntelliJ IDEA 运行它们与 maven-surefire-plugin 但现在我至少知道构建过程是一样的。

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.

这篇关于如何查看IntelliJ IDEA“测试运行器选项卡”?从maven运行测试时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆