chia7712 commented on code in PR #18681:
URL: https://github.com/apache/kafka/pull/18681#discussion_r1934410044
##########
build.gradle:
##########
@@ -492,14 +492,63 @@ subprojects {
// Gradle will run each test class, so we exclude the suites to avoid
redundantly running the tests twice.
def testsToExclude = ['**/*Suite.class']
+
+ // These two tasks will copy JUnit XML files out of the sub-project's build
directory and into
+ // a top-level build/junit-xml directory. This is necessary to avoid
reporting on tests which
+ // were not run, but instead were restored via FROM-CACHE. See KAFKA-17479
for more details.
+ def copyTestXml = tasks.register('copyTestXml') {
+ // Skip this is module has no sources
+ onlyIf("Project '${project.name}:test' has sources") { !
test.state.noSource }
+ onlyIf("Task '${project.name}:test' did not run") { test.state.didWork }
+
+ // Never cache this task
+ outputs.cacheIf { false }
+ outputs.upToDateWhen { false }
+
+ doLast {
+ if (test.ext.isGithubActions) {
Review Comment:
maybe we can move `isGithubActions` to global ext (line#48) to streamline
`test` task?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]