提交 69214429 编写于 作者: S Sam Brannen

Ensure aggregateTestReports task is UP-TO-DATE

Prior to this commit, the standard Gradle `test` task was configured to
execute all JUnit tests and had a dependency on the `testNG` task. In
addition, the `aggregateTestReports` task depended on the results of
the `test` and `testNG` tasks as input. Consequently, a subsequent
execution of the `aggregateTestReports` task would not be considered
UP-TO-DATE since the JUnit and TestNG results were both written to the
same "test" reports folder.

This commit introduces a new `junit` test task that allows JUnit and
TestNG test output to be completely independent. The standard `test`
task now depends on `junit` and `testNG` but does not execute any tests
itself, and the `aggregateTestReports` task now depends on the
individual `junit` and `testNG` results instead of on the mixed `test`
results.

See also: eec183ef
上级 9cb15ba6
......@@ -85,6 +85,17 @@ dependencies {
testRuntime("com.sun.xml.bind:jaxb-impl:2.3.0.1")
}
task junit(type: Test) {
description = "Runs JUnit 4 and JUnit Jupiter tests."
useJUnitPlatform {
excludeTags "failing-test-case"
}
include(["**/*Tests.class", "**/*Test.class"])
exclude(["**/testng/**/*.*"])
// Java Util Logging for the JUnit Platform.
// systemProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager")
}
task testNG(type: Test) {
description = "Runs TestNG tests."
useTestNG()
......@@ -96,21 +107,15 @@ task testNG(type: Test) {
}
test {
description = "Runs JUnit 4 and JUnit Jupiter tests."
dependsOn testNG
useJUnitPlatform {
excludeTags "failing-test-case"
}
include(["**/*Tests.class", "**/*Test.class"])
exclude(["**/testng/**/*.*"])
// Java Util Logging for the JUnit Platform.
// systemProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager")
description = "Runs all tests."
dependsOn junit, testNG
exclude(["**/*.*"])
}
task aggregateTestReports(type: TestReport) {
description = "Aggregates JUnit and TestNG test reports."
destinationDir = test.reports.html.destination
reportOn test, testNG
reportOn junit, testNG
}
check.dependsOn aggregateTestReports
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册