This is an automated email from the ASF dual-hosted git repository. davidarthur pushed a commit to branch mumrah-patch-2 in repository https://gitbox.apache.org/repos/asf/kafka.git
commit 0043e92f0eb2443ac2f3206e019274433bac842d Author: David Arthur <[email protected]> AuthorDate: Thu Dec 5 15:53:28 2024 -0500 MINOR Ensure quarantinedTest always copies test reports --- build.gradle | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 6f58553879b..fb818bf174c 100644 --- a/build.gradle +++ b/build.gradle @@ -546,6 +546,7 @@ subprojects { task quarantinedTest(type: Test, dependsOn: compileJava) { ext { isGithubActions = System.getenv('GITHUB_ACTIONS') != null + hadFailure = false // Used to track if any tests failed, see afterSuite below } // Disable caching and up-to-date for this task. We always want quarantined tests @@ -555,7 +556,7 @@ subprojects { outputs.cacheIf { false } maxParallelForks = maxTestForks - ignoreFailures = userIgnoreFailures + ignoreFailures = userIgnoreFailures || ext.isGithubActions maxHeapSize = defaultMaxHeapSize jvmArgs = defaultJvmArgs @@ -597,6 +598,11 @@ subprojects { ant.include(name: "**/*.xml") } } + // If there were any test failures, we want to fail the task to prevent the failures + // from being cached. + if (ext.hadFailure) { + throw new GradleException("Failing this task since '${project.name}:${name}' had test failures.") + } } } }
