Arn*_*ter 17 testng maven-2 maven-plugin surefire
我想使用TestNG的与神火插件的Maven的.我们的想法是用一个组标记一些测试integrationTest
并运行插件两次:对于test
排除组integrationTest
的目标和仅integration-test
包括组的目标integrationTest
.
我找到了一些用于为两个目标运行插件的材料,但是它可以工作,但是第二次运行的组不起作用(没有执行测试).
这是我的构建元素中的插件配置pom.xml
:
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludedGroups>integrationTest</excludedGroups>
<reportFormat>brief</reportFormat>
<trimStackTrace>true</trimStackTrace>
<useFile>false</useFile>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<groups>integrationTest</groups>
<excludedGroups/>
<reportsDirectory>${project.build.directory}/surefire-reports/integration</reportsDirectory>
</configuration>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
任何的想法?mvn integration-test
按预期运行所有单元测试(不包括组integrationTest
),但第二次测试运行只写:
运行TestSuite
测试运行:0,失败:0,错误:0,跳过:0,已过去时间:0.562秒
结果mvn test
如预期,测试运行和组integrationTest
被忽略.
Arn*_*ter 14
我明白了 - 激怒配置实现!
<excludedGroups/>
不会覆盖<excludedGroups>integrationTest</excludedGroups>
.例如,您需要指定任何(未知)组<excludedGroups>none</excludedGroups>
.
归档时间: |
|
查看次数: |
15433 次 |
最近记录: |