3
在gradle中有一种方法可以将junit xml报告合并到单个测试报告文件中。Gradle合并Junit报告
当我们用cp-suite在ant中执行IntegrationTestSuite.java时,会有一个junit报告。在Gradle上创建多个junit报告。
IntegrationTestSuite.java
@RunWith(Categories.class)
@Categories.IncludeCategory(IntegrationTests.class)
@Categories.ExcludeCategory(DebugJenkinsTests.class)
@Suite.SuiteClasses(AllTestSuite.class)
public class IntegrationTestSuite { /* nop */
}
从build.xml
<junit>
<formatter type="xml" />
<batchtest todir="${testreport.dir}">
<fileset dir="${test-src.dir}">
<include name="**/IntegrationTestSuite.java" />
</fileset>
</batchtest>
</junit>
剪断剪断从build.gradle
task integrationTestSandro(type: Test) {
reports.html.enabled = false
include '**/IntegrationTestSuite*'
reports.junitXml.destination = "$buildDir/test-results/integration"
maxHeapSize = testTaskMaxHeapSize
jvmArgs testTaskJVMArgs
}