Skip to content

Commit 6fec6b9

Browse files
anosek-ananuraagatrask
authored
Migrate agent-instrumenter to jvm test suite (#334)
* configure jvm test suite * add testing suites to check * Update static-instrumenter/agent-instrumenter/build.gradle.kts Co-authored-by: Trask Stalnaker <[email protected]> * Update static-instrumenter/agent-instrumenter/build.gradle.kts Co-authored-by: Anuraag Agrawal <[email protected]> Co-authored-by: Trask Stalnaker <[email protected]>
1 parent 07d7343 commit 6fec6b9

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

static-instrumenter/agent-instrumenter/build.gradle.kts

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
22

33
plugins {
44
id("otel.java-conventions")
5-
id("com.github.johnrengelman.shadow") version "7.1.2"
6-
id("org.unbroken-dome.test-sets") version "4.0.0"
5+
id("com.github.johnrengelman.shadow")
76
}
87

98
description = "OpenTelemetry Java Static Instrumentation Agent"
@@ -33,11 +32,6 @@ dependencies {
3332
javaagentLibs(project(":static-instrumenter:agent-extension"))
3433
}
3534

36-
// TODO: migrate to JVM test suite plugin
37-
testSets {
38-
create("integrationTest")
39-
}
40-
4135
tasks {
4236

4337
val relocateJavaagentLibs by registering(ShadowJar::class) {
@@ -104,9 +98,25 @@ tasks {
10498
dependsOn(shadowJar, createNoInstAgent)
10599
}
106100

107-
val integrationTest by existing(Test::class) {
108-
dependsOn(assemble)
109-
jvmArgumentProviders.add(AgentJarsProvider(shadowJar.flatMap { it.archiveFile }, createNoInstAgent.flatMap { it.archiveFile }))
101+
check {
102+
dependsOn(testing.suites)
103+
}
104+
}
105+
106+
testing {
107+
suites {
108+
val integrationTest by registering(JvmTestSuite::class) {
109+
targets.all {
110+
testTask.configure {
111+
jvmArgumentProviders.add(
112+
AgentJarsProvider(
113+
tasks.shadowJar.flatMap { it.archiveFile },
114+
tasks.named<Jar>("createNoInstAgent").flatMap { it.archiveFile }
115+
)
116+
)
117+
}
118+
}
119+
}
110120
}
111121
}
112122

0 commit comments

Comments
 (0)