-
Notifications
You must be signed in to change notification settings - Fork 312
Refactored AssertJ
, Hamcrest
and Google.Truth
to Junit5.Assertions
.
#9556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactored AssertJ
, Hamcrest
and Google.Truth
to Junit5.Assertions
.
#9556
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 49 metrics, 10 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.54.0-SNAPSHOT~bdc0d0a897, baseline=1.54.0-SNAPSHOT~28bb458edd
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.02 s) : 0, 1019528
Total [baseline] (10.801 s) : 0, 10800770
Agent [candidate] (1.027 s) : 0, 1027275
Total [candidate] (10.722 s) : 0, 10721930
section appsec
Agent [baseline] (1.188 s) : 0, 1188145
Total [baseline] (11.043 s) : 0, 11043348
Agent [candidate] (1.202 s) : 0, 1202354
Total [candidate] (11.024 s) : 0, 11024380
section iast
Agent [baseline] (1.152 s) : 0, 1152040
Total [baseline] (11.049 s) : 0, 11048660
Agent [candidate] (1.153 s) : 0, 1153329
Total [candidate] (11.024 s) : 0, 11023699
section profiling
Agent [baseline] (1.165 s) : 0, 1165059
Total [baseline] (11.063 s) : 0, 11062959
Agent [candidate] (1.161 s) : 0, 1161342
Total [candidate] (10.999 s) : 0, 10998639
gantt
title petclinic - break down per module: candidate=1.54.0-SNAPSHOT~bdc0d0a897, baseline=1.54.0-SNAPSHOT~28bb458edd
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.453 ms) : 0, 1453
crashtracking [candidate] (1.482 ms) : 0, 1482
BytebuddyAgent [baseline] (685.179 ms) : 0, 685179
BytebuddyAgent [candidate] (691.173 ms) : 0, 691173
GlobalTracer [baseline] (258.899 ms) : 0, 258899
GlobalTracer [candidate] (260.206 ms) : 0, 260206
AppSec [baseline] (31.844 ms) : 0, 31844
AppSec [candidate] (31.932 ms) : 0, 31932
Debugger [baseline] (6.37 ms) : 0, 6370
Debugger [candidate] (6.397 ms) : 0, 6397
Remote Config [baseline] (678.061 µs) : 0, 678
Remote Config [candidate] (685.387 µs) : 0, 685
Telemetry [baseline] (14.07 ms) : 0, 14070
Telemetry [candidate] (14.298 ms) : 0, 14298
section appsec
crashtracking [baseline] (1.438 ms) : 0, 1438
crashtracking [candidate] (1.466 ms) : 0, 1466
BytebuddyAgent [baseline] (705.428 ms) : 0, 705428
BytebuddyAgent [candidate] (715.221 ms) : 0, 715221
GlobalTracer [baseline] (248.935 ms) : 0, 248935
GlobalTracer [candidate] (251.737 ms) : 0, 251737
IAST [baseline] (24.845 ms) : 0, 24845
IAST [candidate] (25.079 ms) : 0, 25079
AppSec [baseline] (171.598 ms) : 0, 171598
AppSec [candidate] (170.525 ms) : 0, 170525
Debugger [baseline] (6.032 ms) : 0, 6032
Debugger [candidate] (6.043 ms) : 0, 6043
Remote Config [baseline] (625.505 µs) : 0, 626
Remote Config [candidate] (612.029 µs) : 0, 612
Telemetry [baseline] (8.329 ms) : 0, 8329
Telemetry [candidate] (10.535 ms) : 0, 10535
section iast
crashtracking [baseline] (1.45 ms) : 0, 1450
crashtracking [candidate] (1.469 ms) : 0, 1469
BytebuddyAgent [baseline] (807.179 ms) : 0, 807179
BytebuddyAgent [candidate] (808.055 ms) : 0, 808055
GlobalTracer [baseline] (248.815 ms) : 0, 248815
GlobalTracer [candidate] (249.341 ms) : 0, 249341
IAST [baseline] (28.909 ms) : 0, 28909
IAST [candidate] (31.603 ms) : 0, 31603
AppSec [baseline] (29.845 ms) : 0, 29845
AppSec [candidate] (27.097 ms) : 0, 27097
Debugger [baseline] (6.094 ms) : 0, 6094
Debugger [candidate] (6.11 ms) : 0, 6110
Remote Config [baseline] (617.455 µs) : 0, 617
Remote Config [candidate] (593.485 µs) : 0, 593
Telemetry [baseline] (8.133 ms) : 0, 8133
Telemetry [candidate] (8.164 ms) : 0, 8164
section profiling
crashtracking [baseline] (1.43 ms) : 0, 1430
crashtracking [candidate] (1.436 ms) : 0, 1436
BytebuddyAgent [baseline] (718.959 ms) : 0, 718959
BytebuddyAgent [candidate] (717.161 ms) : 0, 717161
GlobalTracer [baseline] (237.02 ms) : 0, 237020
GlobalTracer [candidate] (235.846 ms) : 0, 235846
AppSec [baseline] (31.412 ms) : 0, 31412
AppSec [candidate] (31.186 ms) : 0, 31186
Debugger [baseline] (6.551 ms) : 0, 6551
Debugger [candidate] (6.48 ms) : 0, 6480
Remote Config [baseline] (694.707 µs) : 0, 695
Remote Config [candidate] (713.017 µs) : 0, 713
Telemetry [baseline] (16.307 ms) : 0, 16307
Telemetry [candidate] (15.829 ms) : 0, 15829
ProfilingAgent [baseline] (101.691 ms) : 0, 101691
ProfilingAgent [candidate] (101.89 ms) : 0, 101890
Profiling [baseline] (102.291 ms) : 0, 102291
Profiling [candidate] (102.483 ms) : 0, 102483
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.54.0-SNAPSHOT~bdc0d0a897, baseline=1.54.0-SNAPSHOT~28bb458edd
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.025 s) : 0, 1024890
Total [baseline] (8.663 s) : 0, 8662886
Agent [candidate] (1.03 s) : 0, 1029604
Total [candidate] (8.67 s) : 0, 8670245
section iast
Agent [baseline] (1.158 s) : 0, 1158008
Total [baseline] (9.36 s) : 0, 9359726
Agent [candidate] (1.157 s) : 0, 1156877
Total [candidate] (9.326 s) : 0, 9326255
gantt
title insecure-bank - break down per module: candidate=1.54.0-SNAPSHOT~bdc0d0a897, baseline=1.54.0-SNAPSHOT~28bb458edd
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.46 ms) : 0, 1460
crashtracking [candidate] (1.463 ms) : 0, 1463
BytebuddyAgent [baseline] (691.734 ms) : 0, 691734
BytebuddyAgent [candidate] (693.301 ms) : 0, 693301
GlobalTracer [baseline] (258.798 ms) : 0, 258798
GlobalTracer [candidate] (261.606 ms) : 0, 261606
AppSec [baseline] (31.676 ms) : 0, 31676
AppSec [candidate] (32.235 ms) : 0, 32235
Debugger [baseline] (6.339 ms) : 0, 6339
Debugger [candidate] (6.429 ms) : 0, 6429
Remote Config [baseline] (705.612 µs) : 0, 706
Remote Config [candidate] (697.757 µs) : 0, 698
Telemetry [baseline] (13.152 ms) : 0, 13152
Telemetry [candidate] (12.789 ms) : 0, 12789
section iast
crashtracking [baseline] (1.467 ms) : 0, 1467
crashtracking [candidate] (1.455 ms) : 0, 1455
BytebuddyAgent [baseline] (811.649 ms) : 0, 811649
BytebuddyAgent [candidate] (811.29 ms) : 0, 811290
GlobalTracer [baseline] (250.007 ms) : 0, 250007
GlobalTracer [candidate] (249.452 ms) : 0, 249452
IAST [baseline] (30.114 ms) : 0, 30114
IAST [candidate] (29.973 ms) : 0, 29973
AppSec [baseline] (28.104 ms) : 0, 28104
AppSec [candidate] (28.893 ms) : 0, 28893
Debugger [baseline] (6.058 ms) : 0, 6058
Debugger [candidate] (6.078 ms) : 0, 6078
Remote Config [baseline] (596.819 µs) : 0, 597
Remote Config [candidate] (599.111 µs) : 0, 599
Telemetry [baseline] (8.981 ms) : 0, 8981
Telemetry [candidate] (8.191 ms) : 0, 8191
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 12 unstable metrics. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.54.0-SNAPSHOT~bdc0d0a897, baseline=1.54.0-SNAPSHOT~28bb458edd
dateFormat X
axisFormat %s
section baseline
no_agent (37.604 ms) : 37292, 37915
. : milestone, 37604,
appsec (48.826 ms) : 48401, 49251
. : milestone, 48826,
code_origins (45.213 ms) : 44812, 45614
. : milestone, 45213,
iast (45.851 ms) : 45437, 46266
. : milestone, 45851,
profiling (49.905 ms) : 49433, 50377
. : milestone, 49905,
tracing (45.208 ms) : 44798, 45618
. : milestone, 45208,
section candidate
no_agent (37.502 ms) : 37203, 37801
. : milestone, 37502,
appsec (49.375 ms) : 48944, 49806
. : milestone, 49375,
code_origins (45.9 ms) : 45513, 46287
. : milestone, 45900,
iast (46.633 ms) : 46229, 47037
. : milestone, 46633,
profiling (49.661 ms) : 49216, 50106
. : milestone, 49661,
tracing (44.281 ms) : 43891, 44671
. : milestone, 44281,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.54.0-SNAPSHOT~bdc0d0a897, baseline=1.54.0-SNAPSHOT~28bb458edd
dateFormat X
axisFormat %s
section baseline
no_agent (4.285 ms) : 4237, 4333
. : milestone, 4285,
iast (9.633 ms) : 9475, 9791
. : milestone, 9633,
iast_FULL (14.782 ms) : 14486, 15079
. : milestone, 14782,
iast_GLOBAL (10.98 ms) : 10784, 11175
. : milestone, 10980,
profiling (9.012 ms) : 8858, 9165
. : milestone, 9012,
tracing (7.759 ms) : 7649, 7868
. : milestone, 7759,
section candidate
no_agent (4.161 ms) : 4112, 4210
. : milestone, 4161,
iast (9.395 ms) : 9240, 9550
. : milestone, 9395,
iast_FULL (14.621 ms) : 14325, 14917
. : milestone, 14621,
iast_GLOBAL (10.897 ms) : 10703, 11091
. : milestone, 10897,
profiling (9.047 ms) : 8905, 9190
. : milestone, 9047,
tracing (7.697 ms) : 7582, 7811
. : milestone, 7697,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.54.0-SNAPSHOT~bdc0d0a897, baseline=1.54.0-SNAPSHOT~28bb458edd
dateFormat X
axisFormat %s
section baseline
no_agent (14.997 s) : 14997000, 14997000
. : milestone, 14997000,
appsec (15.103 s) : 15103000, 15103000
. : milestone, 15103000,
iast (18.654 s) : 18654000, 18654000
. : milestone, 18654000,
iast_GLOBAL (18.19 s) : 18190000, 18190000
. : milestone, 18190000,
profiling (15.425 s) : 15425000, 15425000
. : milestone, 15425000,
tracing (15.08 s) : 15080000, 15080000
. : milestone, 15080000,
section candidate
no_agent (14.922 s) : 14922000, 14922000
. : milestone, 14922000,
appsec (15.022 s) : 15022000, 15022000
. : milestone, 15022000,
iast (18.409 s) : 18409000, 18409000
. : milestone, 18409000,
iast_GLOBAL (18.174 s) : 18174000, 18174000
. : milestone, 18174000,
profiling (15.551 s) : 15551000, 15551000
. : milestone, 15551000,
tracing (15.054 s) : 15054000, 15054000
. : milestone, 15054000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.54.0-SNAPSHOT~bdc0d0a897, baseline=1.54.0-SNAPSHOT~28bb458edd
dateFormat X
axisFormat %s
section baseline
no_agent (1.478 ms) : 1467, 1490
. : milestone, 1478,
appsec (3.736 ms) : 3517, 3956
. : milestone, 3736,
iast (2.209 ms) : 2146, 2272
. : milestone, 2209,
iast_GLOBAL (2.253 ms) : 2189, 2316
. : milestone, 2253,
profiling (2.055 ms) : 2004, 2106
. : milestone, 2055,
tracing (2.034 ms) : 1985, 2084
. : milestone, 2034,
section candidate
no_agent (1.482 ms) : 1471, 1494
. : milestone, 1482,
appsec (3.727 ms) : 3506, 3949
. : milestone, 3727,
iast (2.215 ms) : 2151, 2278
. : milestone, 2215,
iast_GLOBAL (2.267 ms) : 2203, 2330
. : milestone, 2267,
profiling (2.062 ms) : 2011, 2113
. : milestone, 2062,
tracing (2.044 ms) : 1994, 2094
. : milestone, 2044,
|
🎯 Code Coverage 🔗 Commit SHA: bdc0d0a | Docs | Was this helpful? Give us feedback! |
Kafka / producer-benchmarkParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics. See unchanged results
|
Kafka / consumer-benchmarkParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics. See unchanged results
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting changes! Thanks for cleaning up the code base 🤝
(commenting only as it's still a draft)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an opinion, but I don't see the value to remove AssertJ assertions. This library is generally better equiped than Junit (Jupiter) assertions, and it very readable.
I cannot speak for google truth, but this seems a bit redundant wih AssertJ.
buildSrc/src/integTest/kotlin/datadog/gradle/plugin/version/TracerVersionIntegrationTest.kt
Outdated
Show resolved
Hide resolved
utils/test-utils/src/main/java/datadog/trace/test/util/AssertionsUtils.java
Show resolved
Hide resolved
Yep, just added to PR description my motivation and |
Probably yes, maybe I will get rid only of |
My 2cts would be to convert the Junit one to assertj. While that's no small task, I believe there are some automated tools for that. |
AssertJ
and Google.Truth
to Junit5.Assertions
.AssertJ
, Hamcrest
and Google.Truth
to Junit5.Assertions
.
...mentation/maven-3.2.1/src/test/java/datadog/trace/instrumentation/maven3/MavenUtilsTest.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks for cleaning this up!
telemetry/src/test/java/datadog/telemetry/dependency/DependencyServiceTests.java
Show resolved
Hide resolved
...mentation/maven-3.2.1/src/test/java/datadog/trace/instrumentation/maven3/MavenUtilsTest.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks!
# Conflicts: # dd-java-agent/instrumentation/kafka/kafka-connect-0.11/build.gradle
What Does This Do
Refactors test assertions from
AssertJ
,Hamcrest
andGoogle.Truth
toJUnit5.Assertions
.Motivation
Nearly all tests already use
JUnit5
orSpock
assertions.Only a handful of classes relied on
AssertJ
,Hamcrest
andGoogle.Truth
.Consolidating on fewer assertion libraries simplifies the codebase and reduces maintenance overhead.
For context:
JUnit5
assertions are used in 5,000+ places, while others combined appear in fewer than 150-200.Pros & Cons
Pros
JUnit5
is required regardless.JUnit5
.Cons
JUnit5
assertions are less feature-rich thanAssertJ
.Additional Notes
AssertJ
remains as a runtime-only dependency forkafka-clients-0.11
tests, where it is still required.