Skip to content

Commit 0b239ae

Browse files
authored
Decouple test JDK and gradle JDK in selenium latestDepTest (#8236)
* Decouple test JDK and gradle JDK in selenium latestDepTest * Disable selenium latestDepTest until fixed
1 parent 5010e26 commit 0b239ae

File tree

2 files changed

+31
-37
lines changed

2 files changed

+31
-37
lines changed

dd-java-agent/instrumentation/selenium/build.gradle

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ plugins {
22
id 'java-test-fixtures'
33
}
44

5+
ext {
6+
latestDepTestMinJavaVersionForTests = JavaVersion.VERSION_11
7+
}
8+
59
apply from: "$rootDir/gradle/java.gradle"
610

711
muzzle {
@@ -38,9 +42,8 @@ configurations.matching({ it.name.startsWith('test') || it.name.startsWith('late
3842
}
3943
})
4044

41-
tasks.matching { it.name.startsWith('latestDepTest') || it.name.contains('LatestDepTest') }.each {
42-
it.onlyIf {
43-
// Only run latest dep tests tasks (including compilation) if the current JVM is compatible with the latest Selenium version
44-
JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11)
45-
}
45+
tasks.named("compileLatestDepTestJava").configure {
46+
setJavaVersion(it, 11)
47+
sourceCompatibility = JavaVersion.VERSION_1_8
48+
targetCompatibility = JavaVersion.VERSION_1_8
4649
}

dd-java-agent/instrumentation/selenium/src/latestDepTest/resources/test-succeed-multiple/events.ftl

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,25 @@
1111
"start" : ${content_start},
1212
"duration" : ${content_duration},
1313
"error" : 0,
14-
"metrics" : { },
14+
"metrics" : {
15+
"_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count},
16+
"test.source.end" : 19,
17+
"test.source.start" : 11
18+
},
1519
"meta" : {
20+
"_dd.p.tid" : ${content_meta__dd_p_tid},
1621
"test.type" : "test",
17-
"os.architecture" : ${content_meta_os_architecture},
1822
"test.source.file" : "dummy_source_path",
1923
"test.module" : "selenium",
2024
"test.status" : "pass",
21-
"runtime.name" : ${content_meta_runtime_name},
22-
"runtime.vendor" : ${content_meta_runtime_vendor},
25+
"test_session.name" : "session-name",
2326
"env" : "none",
24-
"os.platform" : ${content_meta_os_platform},
2527
"dummy_ci_tag" : "dummy_ci_tag_value",
26-
"os.version" : ${content_meta_os_version},
28+
"test.codeowners" : "[\"owner1\",\"owner2\"]",
2729
"library_version" : ${content_meta_library_version},
2830
"component" : "junit",
2931
"span.kind" : "test_suite_end",
3032
"test.suite" : "org.example.TestSucceedMultipleSelenium",
31-
"runtime.version" : ${content_meta_runtime_version},
3233
"test.framework_version" : ${content_meta_test_framework_version},
3334
"test.framework" : "junit5"
3435
}
@@ -53,32 +54,29 @@
5354
"process_id" : ${content_metrics_process_id},
5455
"_dd.profiling.enabled" : 0,
5556
"_dd.trace_span_attribute_schema" : 0,
57+
"_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2},
5658
"test.source.end" : 18,
5759
"test.source.start" : 12
5860
},
5961
"meta" : {
60-
"os.architecture" : ${content_meta_os_architecture},
6162
"test.browser.driver_version" : ${content_meta_test_browser_driver_version},
63+
"_dd.tracer_host" : ${content_meta__dd_tracer_host},
6264
"test.source.file" : "dummy_source_path",
6365
"test.source.method" : "test_succeed()V",
6466
"test.module" : "selenium",
6567
"test.status" : "pass",
6668
"language" : "jvm",
67-
"runtime.name" : ${content_meta_runtime_name},
6869
"test.browser.name" : "htmlunit",
69-
"os.platform" : ${content_meta_os_platform},
7070
"test.codeowners" : "[\"owner1\",\"owner2\"]",
71-
"os.version" : ${content_meta_os_version},
7271
"library_version" : ${content_meta_library_version},
7372
"test.name" : "test_succeed",
7473
"span.kind" : "test",
7574
"test.suite" : "org.example.TestSucceedMultipleSelenium",
76-
"runtime.version" : ${content_meta_runtime_version},
7775
"runtime-id" : ${content_meta_runtime_id},
7876
"test.type" : "browser",
7977
"test.browser.driver" : "selenium",
8078
"test.is_rum_active" : "true",
81-
"runtime.vendor" : ${content_meta_runtime_vendor},
79+
"test_session.name" : "session-name",
8280
"env" : "none",
8381
"dummy_ci_tag" : "dummy_ci_tag_value",
8482
"component" : "junit",
@@ -108,32 +106,29 @@
108106
"process_id" : ${content_metrics_process_id},
109107
"_dd.profiling.enabled" : 0,
110108
"_dd.trace_span_attribute_schema" : 0,
109+
"_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3},
111110
"test.source.end" : 18,
112111
"test.source.start" : 12
113112
},
114113
"meta" : {
115-
"os.architecture" : ${content_meta_os_architecture},
116114
"test.browser.driver_version" : ${content_meta_test_browser_driver_version},
115+
"_dd.tracer_host" : ${content_meta__dd_tracer_host},
117116
"test.source.file" : "dummy_source_path",
118117
"test.source.method" : "test_succeed_another()V",
119118
"test.module" : "selenium",
120119
"test.status" : "pass",
121120
"language" : "jvm",
122-
"runtime.name" : ${content_meta_runtime_name},
123121
"test.browser.name" : "htmlunit",
124-
"os.platform" : ${content_meta_os_platform},
125122
"test.codeowners" : "[\"owner1\",\"owner2\"]",
126-
"os.version" : ${content_meta_os_version},
127123
"library_version" : ${content_meta_library_version},
128124
"test.name" : "test_succeed_another",
129125
"span.kind" : "test",
130126
"test.suite" : "org.example.TestSucceedMultipleSelenium",
131-
"runtime.version" : ${content_meta_runtime_version},
132127
"runtime-id" : ${content_meta_runtime_id},
133128
"test.type" : "browser",
134129
"test.browser.driver" : "selenium",
135130
"test.is_rum_active" : "true",
136-
"runtime.vendor" : ${content_meta_runtime_vendor},
131+
"test_session.name" : "session-name",
137132
"env" : "none",
138133
"dummy_ci_tag" : "dummy_ci_tag_value",
139134
"component" : "junit",
@@ -155,26 +150,24 @@
155150
"duration" : ${content_duration_4},
156151
"error" : 0,
157152
"metrics" : {
153+
"_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4},
158154
"process_id" : ${content_metrics_process_id},
159155
"_dd.profiling.enabled" : 0,
160156
"_dd.trace_span_attribute_schema" : 0
161157
},
162158
"meta" : {
159+
"_dd.p.tid" : ${content_meta__dd_p_tid_2},
163160
"test.type" : "test",
164-
"os.architecture" : ${content_meta_os_architecture},
161+
"_dd.tracer_host" : ${content_meta__dd_tracer_host},
165162
"test.status" : "pass",
163+
"test_session.name" : "session-name",
166164
"language" : "jvm",
167-
"runtime.name" : ${content_meta_runtime_name},
168-
"runtime.vendor" : ${content_meta_runtime_vendor},
169165
"env" : "none",
170-
"os.platform" : ${content_meta_os_platform},
171166
"dummy_ci_tag" : "dummy_ci_tag_value",
172-
"os.version" : ${content_meta_os_version},
173167
"library_version" : ${content_meta_library_version},
174168
"component" : "junit",
175169
"_dd.profiling.ctx" : "test",
176170
"span.kind" : "test_session_end",
177-
"runtime.version" : ${content_meta_runtime_version},
178171
"runtime-id" : ${content_meta_runtime_id},
179172
"test.command" : "selenium",
180173
"test.framework_version" : ${content_meta_test_framework_version},
@@ -193,22 +186,20 @@
193186
"start" : ${content_start_5},
194187
"duration" : ${content_duration_5},
195188
"error" : 0,
196-
"metrics" : { },
189+
"metrics" : {
190+
"_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}
191+
},
197192
"meta" : {
193+
"_dd.p.tid" : ${content_meta__dd_p_tid_3},
198194
"test.type" : "test",
199-
"os.architecture" : ${content_meta_os_architecture},
200195
"test.module" : "selenium",
201196
"test.status" : "pass",
202-
"runtime.name" : ${content_meta_runtime_name},
203-
"runtime.vendor" : ${content_meta_runtime_vendor},
197+
"test_session.name" : "session-name",
204198
"env" : "none",
205-
"os.platform" : ${content_meta_os_platform},
206199
"dummy_ci_tag" : "dummy_ci_tag_value",
207-
"os.version" : ${content_meta_os_version},
208200
"library_version" : ${content_meta_library_version},
209201
"component" : "junit",
210202
"span.kind" : "test_module_end",
211-
"runtime.version" : ${content_meta_runtime_version},
212203
"test.framework_version" : ${content_meta_test_framework_version},
213204
"test.framework" : "junit5"
214205
}

0 commit comments

Comments
 (0)