/
build.gradle.kts
74 lines (65 loc) · 2.58 KB
/
build.gradle.kts
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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
dependencies {
testCompileOnly("com.google.auto.value:auto-value-annotations")
testAnnotationProcessor("com.google.auto.value:auto-value")
testImplementation(project(":profiler"))
testImplementation("org.testcontainers:testcontainers")
testImplementation("com.fasterxml.jackson.core:jackson-databind")
testImplementation("com.google.protobuf:protobuf-java-util")
testImplementation("com.squareup.okhttp3:okhttp")
testImplementation("io.opentelemetry.proto:opentelemetry-proto")
testImplementation("io.opentelemetry:opentelemetry-api")
testImplementation("io.opentelemetry.javaagent:opentelemetry-javaagent-extension-api")
testImplementation("ch.qos.logback:logback-classic:1.5.6")
testImplementation("com.github.docker-java:docker-java-core")
testImplementation("com.github.docker-java:docker-java-transport-httpclient5")
testImplementation("org.mock-server:mockserver-client-java:5.15.0")
}
tasks {
test {
maxParallelForks = 2
testLogging.showStandardStreams = true
develocity.testRetry {
if (System.getenv().containsKey("CI")) {
// You can see tests that were retried by this mechanism in the collected test reports and build scans.
maxRetries.set(5)
failOnPassedAfterRetry.set(true)
} else {
maxRetries.set(0)
}
}
val suites = mapOf(
"glassfish" to listOf("**/GlassFishSmokeTest.*"),
"jboss" to listOf("**/JBossEapSmokeTest.*"),
"jetty" to listOf("**/JettySmokeTest.*"),
"liberty" to listOf("**/LibertySmokeTest.*"),
"profiler" to listOf("**/Profiler*"),
"tomcat" to listOf("**/TomcatSmokeTest.*"),
"tomee" to listOf("**/TomeeSmokeTest.*"),
"weblogic" to listOf("**/WebLogicSmokeTest.*"),
"websphere" to listOf("**/WebSphereSmokeTest.*"),
"wildfly" to listOf("**/WildFlySmokeTest.*"),
)
val smokeTestSuite: String? by project
if (smokeTestSuite != null) {
when {
"other" == smokeTestSuite -> {
suites.values.forEach {
exclude(it)
}
}
suites.containsKey(smokeTestSuite) -> {
include(suites.getValue(smokeTestSuite!!))
}
else -> {
throw GradleException("Unknown smoke test suite: $smokeTestSuite")
}
}
}
val shadowTask = project(":agent").tasks.named<ShadowJar>("shadowJar").get()
inputs.files(layout.files(shadowTask))
doFirst {
jvmArgs("-Dio.opentelemetry.smoketest.agent.shadowJar.path=${shadowTask.archiveFile.get().asFile.absolutePath}")
}
}
}