-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbuild.gradle
141 lines (107 loc) · 3.37 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
plugins {
id 'java'
}
apply plugin: 'maven-publish'
group = 'com.github.christophschubert'
version = '0.3.0-SNAPSHOT'
java {
sourceCompatibility = JavaVersion.VERSION_17
}
repositories {
mavenCentral()
maven {
url 'https://packages.confluent.io/maven'
}
}
sourceSets {
intTest {
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
resources.srcDirs += "$projectDir/src/test/resources"
}
}
configurations {
intTestImplementation.extendsFrom testImplementation
intTestRuntimeOnly.extendsFrom testRuntimeOnly
}
task integrationTest(type: Test) {
description = "Runs integration tests"
group = 'verification'
testClassesDirs = sourceSets.intTest.output.classesDirs
classpath = sourceSets.intTest.runtimeClasspath
shouldRunAfter test
}
integrationTest.dependsOn test
check.dependsOn integrationTest
ext {
confluentVersion = '7.5.2'
kafkaVersion = '3.5.1'
testContainerVersion = '1.19.3'
}
dependencies {
implementation "org.apache.kafka:connect-api:$kafkaVersion"
implementation "org.apache.kafka:kafka-clients:$kafkaVersion"
implementation "io.confluent:kafka-avro-serializer:$confluentVersion"
implementation "org.testcontainers:testcontainers:$testContainerVersion"
implementation "org.testcontainers:kafka:$testContainerVersion"
implementation 'ch.qos.logback:logback-classic:1.4.14'
intTestImplementation "io.rest-assured:rest-assured:5.4.0"
intTestImplementation "org.awaitility:awaitility:4.2.0"
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation 'org.assertj:assertj-core:3.24.2'
intTestImplementation group: 'org.testcontainers', name: 'junit-jupiter', version: testContainerVersion
// for localstack/S3 connector integration test
intTestImplementation "org.testcontainers:localstack:$testContainerVersion"
intTestImplementation "com.amazonaws:aws-java-sdk-core:1.12.780"
intTestImplementation "software.amazon.awssdk:s3:2.22.9"
intTestCompileOnly 'org.projectlombok:lombok:1.18.30'
intTestAnnotationProcessor 'org.projectlombok:lombok:1.18.30'
}
test {
useJUnitPlatform()
// Enable parallel test execution
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
// Enable test forking
forkEvery = 100
// Increase heap space if needed
minHeapSize = "256m"
maxHeapSize = "1g"
}
integrationTest {
useJUnitPlatform()
// Enable parallel test execution for integration tests
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
// Enable test forking for integration tests
forkEvery = 100
// Increase heap space if needed
minHeapSize = "512m"
maxHeapSize = "2g"
testLogging {
outputs.upToDateWhen { false }
showStandardStreams = false
events "passed", "skipped", "failed"
exceptionFormat "full"
}
}
// Enable Gradle parallel execution
gradle.startParameter.maxWorkerCount = Runtime.runtime.availableProcessors()
// Enable parallel compilation
tasks.withType(JavaCompile) {
options.fork = true
options.compilerArgs = [
'-Xlint:unchecked',
'-Xlint:deprecation',
'-Werror'
]
}
publishing {
publications {
maven(MavenPublication) {
groupId = project.getGroup()
artifactId = project.getName()
version = project.getVersion()
from components.java
}
}
}