Skip to content

Commit 5e67772

Browse files
committed
feat(sofa-rpc): add stable and both semconv test suites and update metrics assertions
1 parent bfba876 commit 5e67772

4 files changed

Lines changed: 802 additions & 313 deletions

File tree

instrumentation/sofa-rpc-5.4/javaagent/build.gradle.kts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,29 @@ tasks.withType<Test>().configureEach {
4949
systemProperty("collectMetadata", otelProps.collectMetadata)
5050
}
5151

52+
val stableSemconvSuites = testing.suites.withType(JvmTestSuite::class).map { suite ->
53+
tasks.register<Test>("${suite.name}StableSemconv") {
54+
testClassesDirs = suite.sources.output.classesDirs
55+
classpath = suite.sources.runtimeClasspath
56+
57+
jvmArgs("-Dotel.semconv-stability.opt-in=rpc,service.peer")
58+
systemProperty("metadataConfig", "otel.semconv-stability.opt-in=rpc,service.peer")
59+
}
60+
}
61+
62+
val bothSemconvSuites = testing.suites.withType(JvmTestSuite::class).map { suite ->
63+
tasks.register<Test>("${suite.name}BothSemconv") {
64+
testClassesDirs = suite.sources.output.classesDirs
65+
classpath = suite.sources.runtimeClasspath
66+
67+
jvmArgs("-Dotel.semconv-stability.opt-in=rpc/dup,service.peer")
68+
systemProperty("metadataConfig", "otel.semconv-stability.opt-in=rpc/dup,service.peer")
69+
}
70+
}
71+
5272
tasks {
5373
check {
54-
dependsOn(testing.suites)
74+
dependsOn(testing.suites, stableSemconvSuites, bothSemconvSuites)
5575
}
5676
}
5777

instrumentation/sofa-rpc-5.4/library-autoconfigure/build.gradle.kts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,32 @@ configurations.testRuntimeClasspath {
2222
}
2323

2424
tasks.withType<Test>().configureEach {
25+
systemProperty("testLatestDeps", otelProps.testLatestDeps)
2526
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
2627
// to suppress non-fatal errors on jdk17
2728
jvmArgs("--add-opens=java.base/java.math=ALL-UNNAMED")
2829
// required on jdk17
2930
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
3031
}
32+
33+
tasks {
34+
val testStableSemconv by registering(Test::class) {
35+
testClassesDirs = sourceSets.test.get().output.classesDirs
36+
classpath = sourceSets.test.get().runtimeClasspath
37+
38+
jvmArgs("-Dotel.semconv-stability.opt-in=rpc")
39+
systemProperty("metadataConfig", "otel.semconv-stability.opt-in=rpc")
40+
}
41+
42+
val testBothSemconv by registering(Test::class) {
43+
testClassesDirs = sourceSets.test.get().output.classesDirs
44+
classpath = sourceSets.test.get().runtimeClasspath
45+
46+
jvmArgs("-Dotel.semconv-stability.opt-in=rpc/dup")
47+
systemProperty("metadataConfig", "otel.semconv-stability.opt-in=rpc/dup")
48+
}
49+
50+
check {
51+
dependsOn(testStableSemconv, testBothSemconv)
52+
}
53+
}

0 commit comments

Comments
 (0)