Skip to content

Commit

Permalink
Setup Harness Test Intelligence (#1)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
anurag-harness authored Nov 11, 2022
1 parent 9ab140d commit 0d888f6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .ticonfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
config:
ignore:
- "README.md"
- ".ticonfig.yaml"
- "**/*.md"
- "**/*.txt"
22 changes: 19 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
}
Expand Down Expand Up @@ -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)) {
Expand All @@ -417,7 +425,7 @@ subprojects {

test {
maxParallelForks = maxTestForks
ignoreFailures = userIgnoreFailures
ignoreFailures = true

maxHeapSize = defaultMaxHeapSize
jvmArgs = defaultJvmArgs
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0d888f6

Please sign in to comment.