Skip to content

Commit a10eaad

Browse files
committed
Merge branch 'master' into sarahchen6/pin-system-tests-workflow
2 parents 50aa6d5 + 1ad22e7 commit a10eaad

File tree

9 files changed

+50
-55
lines changed

9 files changed

+50
-55
lines changed

.github/chainguard/self.pin-system-tests.create-pr.sts.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ subject_pattern: repo:DataDog/dd-trace-java:ref:refs/heads/.+
55
claim_pattern:
66
event_name: (push|workflow_dispatch)
77
ref: refs/heads/.+
8-
job_workflow_ref: DataDog/dd-trace-java/\.github/workflows/pin-system-tests\.yaml@.+
8+
job_workflow_ref: DataDog/dd-trace-java/\.github/workflows/pin-system-tests\.yaml@refs/heads/.+
99

1010
permissions:
1111
contents: write

dd-java-agent/agent-iast/src/test/groovy/com/datadog/iast/propagation/CodecModuleTest.groovy

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,10 @@ class CodecModuleTest extends IastModuleImplTestBase {
290290
then:
291291
final helloTainted = to.get(hello)
292292
helloTainted.ranges.length == 1
293-
helloTainted.ranges.first().with {
294-
assert it.source.origin == (byte) 0
295-
assert it.source.name == 'name1'
296-
assert it.source.value == 'Hello'
293+
with(helloTainted.ranges.first()) {
294+
it.source.origin == (byte) 0
295+
it.source.name == 'name1'
296+
it.source.value == 'Hello'
297297
}
298298

299299
when:
@@ -303,10 +303,10 @@ class CodecModuleTest extends IastModuleImplTestBase {
303303
then:
304304
final worldTainted = to.get(world)
305305
worldTainted.ranges.length == 1
306-
worldTainted.ranges.first().with {
307-
assert it.source.origin == (byte) 1
308-
assert it.source.name == 'name2'
309-
assert it.source.value == 'World!'
306+
with(worldTainted.ranges.first()) {
307+
it.source.origin == (byte) 1
308+
it.source.name == 'name2'
309+
it.source.value == 'World!'
310310
}
311311
}
312312

dd-java-agent/agent-tooling/src/test/groovy/datadog/trace/agent/tooling/iast/IastPostProcessorFactoryTest.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ class IastPostProcessorFactoryTest extends DDSpecification {
7676
final metrics = collector.drain()
7777
assert metrics.size() == 1
7878
// one method has ben instrumented
79-
metrics.first().with {
80-
assert it.metric == IastMetric.INSTRUMENTED_SINK
81-
assert it.tags == ['vulnerability_type:SQL_INJECTION']
82-
assert it.value == 1L
79+
with(metrics.first()) {
80+
it.metric == IastMetric.INSTRUMENTED_SINK
81+
it.tags == ['vulnerability_type:SQL_INJECTION']
82+
it.value == 1L
8383
}
8484

8585
when: 'the advice is used'

dd-java-agent/appsec/src/test/groovy/com/datadog/appsec/event/data/UnionDataBundleSpecification.groovy

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ class UnionDataBundleSpecification extends Specification {
2626
expect:
2727
assert it.hasNext() == true
2828

29-
it.next().with { e ->
30-
assert e.key == KnownAddresses.REQUEST_URI_RAW
31-
assert e.value == '/'
29+
with(it.next()) { e ->
30+
e.key == KnownAddresses.REQUEST_URI_RAW
31+
e.value == '/'
3232
}
3333

3434
assert it.hasNext() == true
35-
it.next().with { e ->
36-
assert e.key == KnownAddresses.REQUEST_SCHEME
37-
assert e.value == 'http'
35+
with(it.next()) { e ->
36+
e.key == KnownAddresses.REQUEST_SCHEME
37+
e.value == 'http'
3838
}
3939

4040
assert it.hasNext() == false

dd-java-agent/instrumentation/guava-10.0/build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,10 @@ dependencies {
2424

2525
latestDepTestImplementation group: 'com.google.guava', name: 'guava', version: '+'
2626
}
27+
28+
// Exclude helper class from test execution to avoid JUnit 5.14+ discovering it as test
29+
tasks.withType(Test).configureEach {
30+
filter {
31+
excludeTestsMatching 'annotatedsample.GuavaTracedMethods*'
32+
}
33+
}

dd-java-agent/instrumentation/junit/junit-5.3/spock-junit-5/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ dependencies {
2727
testImplementation project(':dd-java-agent:agent-ci-visibility:civisibility-instrumentation-test-fixtures')
2828

2929
testImplementation group: 'org.junit.platform', name: 'junit-platform-launcher', version: libs.versions.junit.platform.get()
30-
testImplementation group: 'org.spockframework', name: 'spock-core', version: "2.2-groovy-${spockGroovyVersion}"
30+
testImplementation group: 'org.spockframework', name: 'spock-core', version: "2.4-groovy-${spockGroovyVersion}"
3131

3232
latestDepTestImplementation group: 'org.spockframework', name: 'spock-core', version: '2.+'
3333
}
3434

3535
configurations.matching({ it.name.startsWith('test') }).configureEach({
3636
it.resolutionStrategy {
3737
force group: 'org.junit.platform', name: 'junit-platform-launcher', version: libs.versions.junit.platform.get()
38-
force group: 'org.spockframework', name: 'spock-core', version: "2.2-groovy-${spockGroovyVersion}"
38+
force group: 'org.spockframework', name: 'spock-core', version: "2.4-groovy-${spockGroovyVersion}"
3939
}
4040
})
4141

dd-java-agent/instrumentation/junit/junit-5.3/spock-junit-5/gradle.lockfile

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -130,34 +130,23 @@ org.jacoco:org.jacoco.core:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClass
130130
org.jacoco:org.jacoco.report:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClasspath
131131
org.jctools:jctools-core:3.3.0=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath
132132
org.jetbrains:annotations:20.1.0=compileClasspath
133-
org.junit.jupiter:junit-jupiter-api:5.12.2=testCompileClasspath,testRuntimeClasspath
134-
org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
133+
org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
135134
org.junit.jupiter:junit-jupiter-api:5.7.2=compileClasspath
136-
org.junit.jupiter:junit-jupiter-engine:5.12.2=testRuntimeClasspath
137-
org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath
138-
org.junit.jupiter:junit-jupiter-params:5.12.2=testCompileClasspath,testRuntimeClasspath
139-
org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
140-
org.junit.jupiter:junit-jupiter:5.12.2=testCompileClasspath,testRuntimeClasspath
141-
org.junit.jupiter:junit-jupiter:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
142-
org.junit.platform:junit-platform-commons:1.12.2=testCompileClasspath,testRuntimeClasspath
143-
org.junit.platform:junit-platform-commons:1.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
135+
org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath
136+
org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
137+
org.junit.jupiter:junit-jupiter:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
138+
org.junit.platform:junit-platform-commons:1.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
144139
org.junit.platform:junit-platform-commons:1.7.2=compileClasspath
145-
org.junit.platform:junit-platform-engine:1.12.2=testCompileClasspath,testRuntimeClasspath
146-
org.junit.platform:junit-platform-engine:1.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
140+
org.junit.platform:junit-platform-engine:1.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
147141
org.junit.platform:junit-platform-engine:1.7.2=compileClasspath
148-
org.junit.platform:junit-platform-launcher:1.12.2=testCompileClasspath,testRuntimeClasspath
149-
org.junit.platform:junit-platform-launcher:1.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
142+
org.junit.platform:junit-platform-launcher:1.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
150143
org.junit.platform:junit-platform-launcher:1.7.2=compileClasspath
151-
org.junit.platform:junit-platform-runner:1.12.2=testRuntimeClasspath
152-
org.junit.platform:junit-platform-runner:1.14.1=latestDepTestRuntimeClasspath
153-
org.junit.platform:junit-platform-suite-api:1.12.2=testRuntimeClasspath
154-
org.junit.platform:junit-platform-suite-api:1.14.1=latestDepTestRuntimeClasspath
155-
org.junit.platform:junit-platform-suite-commons:1.12.2=testRuntimeClasspath
156-
org.junit.platform:junit-platform-suite-commons:1.14.1=latestDepTestRuntimeClasspath
144+
org.junit.platform:junit-platform-runner:1.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath
145+
org.junit.platform:junit-platform-suite-api:1.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath
146+
org.junit.platform:junit-platform-suite-commons:1.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath
157147
org.junit.platform:junit-platform-testkit:1.7.2=compileClasspath
158-
org.junit:junit-bom:5.12.2=testCompileClasspath,testRuntimeClasspath
159148
org.junit:junit-bom:5.14.0=spotbugs
160-
org.junit:junit-bom:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
149+
org.junit:junit-bom:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
161150
org.junit:junit-bom:5.7.2=compileClasspath
162151
org.mockito:mockito-core:4.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath
163152
org.msgpack:jackson-dataformat-msgpack:0.9.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
@@ -187,10 +176,9 @@ org.slf4j:slf4j-api:1.7.36=latestDepTestRuntimeClasspath,testRuntimeClasspath
187176
org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j
188177
org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j
189178
org.snakeyaml:snakeyaml-engine:2.9=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath
190-
org.spockframework:spock-bom:2.4-M6-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
179+
org.spockframework:spock-bom:2.4-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
191180
org.spockframework:spock-core:2.0-groovy-3.0=compileClasspath
192-
org.spockframework:spock-core:2.2-groovy-3.0=testCompileClasspath,testRuntimeClasspath
193-
org.spockframework:spock-core:2.4-M6-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
181+
org.spockframework:spock-core:2.4-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
194182
org.testng:testng:7.5.1=latestDepTestRuntimeClasspath,testRuntimeClasspath
195183
org.webjars:jquery:3.5.1=latestDepTestRuntimeClasspath,testRuntimeClasspath
196184
org.xmlresolver:xmlresolver:5.3.3=spotbugs

dd-smoke-tests/appsec/springboot/src/test/groovy/datadog/smoketest/appsec/AIGuardSmokeTest.groovy

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ class AIGuardSmokeTest extends AbstractAppSecServerSmokeTest {
7474
assert span.meta.get('ai_guard.target') == 'prompt'
7575
final messages = span.metaStruct.get('ai_guard').messages as List<Map<String, Object>>
7676
assert messages.size() == 2
77-
messages[0].with {
78-
assert role == 'system'
79-
assert content == 'You are a beautiful AI'
77+
with(messages[0]) {
78+
role == 'system'
79+
content == 'You are a beautiful AI'
8080
}
81-
messages[1].with {
82-
assert role == 'user'
83-
assert content != null
81+
with(messages[1]) {
82+
role == 'user'
83+
content != null
8484
}
8585

8686
where:

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ moshi = "1.11.0"
6363

6464
# Testing
6565
junit4 = "4.13.2"
66-
junit5 = "5.12.2"
67-
junit-platform = "1.12.2"
66+
junit5 = "5.14.1"
67+
junit-platform = "1.14.1"
6868
mockito = "4.4.0"
69-
spock = "2.4-M6-groovy-3.0"
69+
spock = "2.4-groovy-3.0"
7070
testcontainers = "1.21.3"
7171

7272
[libraries]

0 commit comments

Comments
 (0)