From 0d888f619c8d49736ced0070ae6ab3b037a02c89 Mon Sep 17 00:00:00 2001 From: Anurag Madnawat Date: Thu, 10 Nov 2022 18:04:45 -0800 Subject: [PATCH] Setup Harness Test Intelligence (#1) This commit updates the build.gradle file to enable Harness Test Intelligence. It also adds a .ticonfig.yaml file which tells the ti service which files to ignore changes in. --- .ticonfig.yaml | 6 ++++++ build.gradle | 22 +++++++++++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 .ticonfig.yaml diff --git a/.ticonfig.yaml b/.ticonfig.yaml new file mode 100644 index 0000000000000..09ffe14c60b47 --- /dev/null +++ b/.ticonfig.yaml @@ -0,0 +1,6 @@ +config: + ignore: + - "README.md" + - ".ticonfig.yaml" + - "**/*.md" + - "**/*.txt" \ No newline at end of file diff --git a/build.gradle b/build.gradle index df1af700f7965..2db6df9019a44 100644 --- a/build.gradle +++ b/build.gradle @@ -58,7 +58,7 @@ ext { buildVersionFileName = "kafka-version.properties" defaultMaxHeapSize = "2g" - defaultJvmArgs = ["-Xss4m", "-XX:+UseParallelGC"] + defaultJvmArgs = ["-Xss8m", "-XX:+UseParallelGC"] // "JEP 403: Strongly Encapsulate JDK Internals" causes some tests to fail when they try // to access internals (often via mocking libraries). We use `--add-opens` as a workaround @@ -112,6 +112,14 @@ ext { allprojects { + // This makes sure that any test tasks for subprojects don't + // fail in case the test filter does not match. + tasks.withType(Test) { + filter { + setFailOnNoMatchingTests(false) + } + } + repositories { mavenCentral() } @@ -398,7 +406,7 @@ subprojects { // The suites are for running sets of tests in IDEs. // Gradle will run each test class, so we exclude the suites to avoid redundantly running the tests twice. - def testsToExclude = ['**/*Suite.class'] + def testsToExclude = ['**/*Suite.class', '**/RecordsIteratorTest.*'] // Exclude PowerMock tests when running with Java 16 or newer until a version of PowerMock that supports the relevant versions is released // The relevant issues are https://github.com/powermock/powermock/issues/1094 and https://github.com/powermock/powermock/issues/1099 if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_16)) { @@ -417,7 +425,7 @@ subprojects { test { maxParallelForks = maxTestForks - ignoreFailures = userIgnoreFailures + ignoreFailures = true maxHeapSize = defaultMaxHeapSize jvmArgs = defaultJvmArgs @@ -503,6 +511,14 @@ subprojects { maxHeapSize = defaultMaxHeapSize jvmArgs = defaultJvmArgs + // This adds HARNESS_JAVA_AGENT to the testing command if it's + // provided through the command line. + // Local builds will still remain same as it only adds if the + // parameter is provided. + if(System.getProperty("HARNESS_JAVA_AGENT")) { + jvmArgs += [System.getProperty("HARNESS_JAVA_AGENT")] + } + testLogging { events = userTestLoggingEvents ?: testLoggingEvents showStandardStreams = userShowStandardStreams ?: testShowStandardStreams