Fix Cucumber JUnit 4 instrumentation to correctly handle feature and scenario names with brackets#7446
Merged
nikita-tkachenko-datadog merged 2 commits intomasterfrom Aug 16, 2024
Conversation
…scenario names with brackets
5 tasks
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 45 metrics, 18 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.39.0-SNAPSHOT~a1bb2e123c, baseline=1.39.0-SNAPSHOT~fcd4bc4862
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.055 s) : 0, 1055201
Total [baseline] (10.331 s) : 0, 10331300
Agent [candidate] (1.053 s) : 0, 1053254
Total [candidate] (10.293 s) : 0, 10293314
section appsec
Agent [baseline] (1.172 s) : 0, 1172142
Total [baseline] (10.458 s) : 0, 10457971
Agent [candidate] (1.175 s) : 0, 1174638
Total [candidate] (10.516 s) : 0, 10515968
section iast
Agent [baseline] (1.176 s) : 0, 1176479
Total [baseline] (10.817 s) : 0, 10817461
Agent [candidate] (1.184 s) : 0, 1184439
Total [candidate] (10.819 s) : 0, 10818943
section profiling
Agent [baseline] (1.246 s) : 0, 1246326
Total [baseline] (10.562 s) : 0, 10561964
Agent [candidate] (1.246 s) : 0, 1246289
Total [candidate] (10.551 s) : 0, 10551268
gantt
title petclinic - break down per module: candidate=1.39.0-SNAPSHOT~a1bb2e123c, baseline=1.39.0-SNAPSHOT~fcd4bc4862
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (672.983 ms) : 0, 672983
BytebuddyAgent [candidate] (672.1 ms) : 0, 672100
GlobalTracer [baseline] (309.025 ms) : 0, 309025
GlobalTracer [candidate] (308.411 ms) : 0, 308411
AppSec [baseline] (51.402 ms) : 0, 51402
AppSec [candidate] (51.108 ms) : 0, 51108
Remote Config [baseline] (692.131 µs) : 0, 692
Remote Config [candidate] (682.108 µs) : 0, 682
Telemetry [baseline] (7.581 ms) : 0, 7581
Telemetry [candidate] (7.431 ms) : 0, 7431
section appsec
BytebuddyAgent [baseline] (679.757 ms) : 0, 679757
BytebuddyAgent [candidate] (681.554 ms) : 0, 681554
GlobalTracer [baseline] (300.135 ms) : 0, 300135
GlobalTracer [candidate] (301.295 ms) : 0, 301295
AppSec [baseline] (157.511 ms) : 0, 157511
AppSec [candidate] (157.743 ms) : 0, 157743
Remote Config [baseline] (599.936 µs) : 0, 600
Remote Config [candidate] (607.987 µs) : 0, 608
Telemetry [baseline] (8.956 ms) : 0, 8956
Telemetry [candidate] (9.689 ms) : 0, 9689
IAST [baseline] (23.391 ms) : 0, 23391
IAST [candidate] (20.407 ms) : 0, 20407
section iast
BytebuddyAgent [baseline] (783.156 ms) : 0, 783156
BytebuddyAgent [candidate] (788.181 ms) : 0, 788181
GlobalTracer [baseline] (296.588 ms) : 0, 296588
GlobalTracer [candidate] (298.244 ms) : 0, 298244
AppSec [baseline] (50.655 ms) : 0, 50655
AppSec [candidate] (54.943 ms) : 0, 54943
Remote Config [baseline] (612.546 µs) : 0, 613
Remote Config [candidate] (574.01 µs) : 0, 574
Telemetry [baseline] (7.894 ms) : 0, 7894
Telemetry [candidate] (7.971 ms) : 0, 7971
IAST [baseline] (24.091 ms) : 0, 24091
IAST [candidate] (20.952 ms) : 0, 20952
section profiling
BytebuddyAgent [baseline] (663.397 ms) : 0, 663397
BytebuddyAgent [candidate] (663.535 ms) : 0, 663535
GlobalTracer [baseline] (391.011 ms) : 0, 391011
GlobalTracer [candidate] (390.735 ms) : 0, 390735
AppSec [baseline] (52.133 ms) : 0, 52133
AppSec [candidate] (52.084 ms) : 0, 52084
Remote Config [baseline] (682.301 µs) : 0, 682
Remote Config [candidate] (695.519 µs) : 0, 696
Telemetry [baseline] (7.384 ms) : 0, 7384
Telemetry [candidate] (7.455 ms) : 0, 7455
ProfilingAgent [baseline] (94.491 ms) : 0, 94491
ProfilingAgent [candidate] (94.539 ms) : 0, 94539
Profiling [baseline] (94.516 ms) : 0, 94516
Profiling [candidate] (94.564 ms) : 0, 94564
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.39.0-SNAPSHOT~a1bb2e123c, baseline=1.39.0-SNAPSHOT~fcd4bc4862
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.052 s) : 0, 1051714
Total [baseline] (8.518 s) : 0, 8517989
Agent [candidate] (1.046 s) : 0, 1045896
Total [candidate] (8.518 s) : 0, 8517686
section iast
Agent [baseline] (1.18 s) : 0, 1180085
Total [baseline] (9.043 s) : 0, 9042949
Agent [candidate] (1.182 s) : 0, 1182052
Total [candidate] (9.025 s) : 0, 9025409
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.176 s) : 0, 1175958
Total [baseline] (8.96 s) : 0, 8960434
Agent [candidate] (1.204 s) : 0, 1204072
Total [candidate] (9.043 s) : 0, 9042971
section iast_TELEMETRY_OFF
Agent [baseline] (1.173 s) : 0, 1173321
Total [baseline] (8.97 s) : 0, 8969815
Agent [candidate] (1.181 s) : 0, 1181354
Total [candidate] (8.991 s) : 0, 8990865
gantt
title insecure-bank - break down per module: candidate=1.39.0-SNAPSHOT~a1bb2e123c, baseline=1.39.0-SNAPSHOT~fcd4bc4862
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (672.326 ms) : 0, 672326
BytebuddyAgent [candidate] (667.218 ms) : 0, 667218
GlobalTracer [baseline] (306.664 ms) : 0, 306664
GlobalTracer [candidate] (306.154 ms) : 0, 306154
AppSec [baseline] (51.008 ms) : 0, 51008
AppSec [candidate] (50.838 ms) : 0, 50838
Remote Config [baseline] (687.081 µs) : 0, 687
Remote Config [candidate] (818.225 µs) : 0, 818
Telemetry [baseline] (7.547 ms) : 0, 7547
Telemetry [candidate] (7.464 ms) : 0, 7464
section iast
BytebuddyAgent [baseline] (783.529 ms) : 0, 783529
BytebuddyAgent [candidate] (786.901 ms) : 0, 786901
GlobalTracer [baseline] (298.352 ms) : 0, 298352
GlobalTracer [candidate] (297.365 ms) : 0, 297365
AppSec [baseline] (52.784 ms) : 0, 52784
AppSec [candidate] (50.75 ms) : 0, 50750
IAST [baseline] (22.505 ms) : 0, 22505
IAST [candidate] (24.26 ms) : 0, 24260
Remote Config [baseline] (580.657 µs) : 0, 581
Remote Config [candidate] (573.88 µs) : 0, 574
Telemetry [baseline] (8.85 ms) : 0, 8850
Telemetry [candidate] (8.643 ms) : 0, 8643
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (781.555 ms) : 0, 781555
BytebuddyAgent [candidate] (801.373 ms) : 0, 801373
GlobalTracer [baseline] (296.489 ms) : 0, 296489
GlobalTracer [candidate] (302.458 ms) : 0, 302458
AppSec [baseline] (48.326 ms) : 0, 48326
AppSec [candidate] (51.093 ms) : 0, 51093
IAST [baseline] (23.701 ms) : 0, 23701
IAST [candidate] (24.967 ms) : 0, 24967
Remote Config [baseline] (591.57 µs) : 0, 592
Remote Config [candidate] (604.576 µs) : 0, 605
Telemetry [baseline] (11.825 ms) : 0, 11825
Telemetry [candidate] (9.745 ms) : 0, 9745
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (780.525 ms) : 0, 780525
BytebuddyAgent [candidate] (786.676 ms) : 0, 786676
GlobalTracer [baseline] (297.569 ms) : 0, 297569
GlobalTracer [candidate] (298.629 ms) : 0, 298629
AppSec [baseline] (51.09 ms) : 0, 51090
AppSec [candidate] (52.471 ms) : 0, 52471
IAST [baseline] (22.966 ms) : 0, 22966
IAST [candidate] (21.448 ms) : 0, 21448
Remote Config [baseline] (605.609 µs) : 0, 606
Remote Config [candidate] (618.341 µs) : 0, 618
Telemetry [baseline] (7.078 ms) : 0, 7078
Telemetry [candidate] (7.904 ms) : 0, 7904
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 16 unstable metrics. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.39.0-SNAPSHOT~a1bb2e123c, baseline=1.39.0-SNAPSHOT~fcd4bc4862
dateFormat X
axisFormat %s
section baseline
no_agent (1.351 ms) : 1332, 1371
. : milestone, 1351,
appsec (1.716 ms) : 1693, 1740
. : milestone, 1716,
appsec_no_iast (1.711 ms) : 1687, 1735
. : milestone, 1711,
iast (1.469 ms) : 1447, 1492
. : milestone, 1469,
profiling (1.48 ms) : 1455, 1505
. : milestone, 1480,
tracing (1.468 ms) : 1443, 1492
. : milestone, 1468,
section candidate
no_agent (1.343 ms) : 1323, 1364
. : milestone, 1343,
appsec (1.731 ms) : 1709, 1753
. : milestone, 1731,
appsec_no_iast (1.718 ms) : 1695, 1742
. : milestone, 1718,
iast (1.474 ms) : 1451, 1496
. : milestone, 1474,
profiling (1.536 ms) : 1510, 1563
. : milestone, 1536,
tracing (1.473 ms) : 1449, 1497
. : milestone, 1473,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.39.0-SNAPSHOT~a1bb2e123c, baseline=1.39.0-SNAPSHOT~fcd4bc4862
dateFormat X
axisFormat %s
section baseline
no_agent (361.421 µs) : 342, 381
. : milestone, 361,
iast (476.825 µs) : 455, 498
. : milestone, 477,
iast_FULL (549.442 µs) : 527, 572
. : milestone, 549,
iast_GLOBAL (500.399 µs) : 478, 523
. : milestone, 500,
iast_HARDCODED_SECRET_DISABLED (473.478 µs) : 453, 494
. : milestone, 473,
iast_INACTIVE (449.085 µs) : 427, 471
. : milestone, 449,
iast_TELEMETRY_OFF (467.758 µs) : 446, 489
. : milestone, 468,
tracing (432.514 µs) : 412, 453
. : milestone, 433,
section candidate
no_agent (363.741 µs) : 344, 383
. : milestone, 364,
iast (484.944 µs) : 464, 506
. : milestone, 485,
iast_FULL (550.728 µs) : 528, 573
. : milestone, 551,
iast_GLOBAL (513.647 µs) : 490, 538
. : milestone, 514,
iast_HARDCODED_SECRET_DISABLED (479.544 µs) : 459, 500
. : milestone, 480,
iast_INACTIVE (448.463 µs) : 426, 471
. : milestone, 448,
iast_TELEMETRY_OFF (461.311 µs) : 440, 482
. : milestone, 461,
tracing (434.27 µs) : 414, 454
. : milestone, 434,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.39.0-SNAPSHOT~a1bb2e123c, baseline=1.39.0-SNAPSHOT~fcd4bc4862
dateFormat X
axisFormat %s
section baseline
no_agent (15.24 s) : 15240000, 15240000
. : milestone, 15240000,
appsec (14.778 s) : 14778000, 14778000
. : milestone, 14778000,
iast (18.982 s) : 18982000, 18982000
. : milestone, 18982000,
iast_GLOBAL (17.732 s) : 17732000, 17732000
. : milestone, 17732000,
profiling (15.068 s) : 15068000, 15068000
. : milestone, 15068000,
tracing (14.758 s) : 14758000, 14758000
. : milestone, 14758000,
section candidate
no_agent (15.172 s) : 15172000, 15172000
. : milestone, 15172000,
appsec (15.038 s) : 15038000, 15038000
. : milestone, 15038000,
iast (19.231 s) : 19231000, 19231000
. : milestone, 19231000,
iast_GLOBAL (17.882 s) : 17882000, 17882000
. : milestone, 17882000,
profiling (15.849 s) : 15849000, 15849000
. : milestone, 15849000,
tracing (15.089 s) : 15089000, 15089000
. : milestone, 15089000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.39.0-SNAPSHOT~a1bb2e123c, baseline=1.39.0-SNAPSHOT~fcd4bc4862
dateFormat X
axisFormat %s
section baseline
no_agent (1.458 ms) : 1446, 1469
. : milestone, 1458,
appsec (2.232 ms) : 2197, 2267
. : milestone, 2232,
iast (1.992 ms) : 1949, 2035
. : milestone, 1992,
iast_GLOBAL (2.011 ms) : 1969, 2054
. : milestone, 2011,
profiling (1.867 ms) : 1833, 1901
. : milestone, 1867,
tracing (1.831 ms) : 1798, 1864
. : milestone, 1831,
section candidate
no_agent (1.458 ms) : 1447, 1470
. : milestone, 1458,
appsec (2.214 ms) : 2179, 2249
. : milestone, 2214,
iast (1.961 ms) : 1920, 2003
. : milestone, 1961,
iast_GLOBAL (2.02 ms) : 1976, 2063
. : milestone, 2020,
profiling (1.853 ms) : 1819, 1887
. : milestone, 1853,
tracing (1.84 ms) : 1807, 1873
. : milestone, 1840,
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This Do
Fixes Cucumber JUnit 4 instrumentation to correctly work if the name of traced feature/scenario contains bracket characters.
Additional Notes
Previously the instrumentation logic relied on standard
Description.getClassName()andDescription.getMethodName()methods available in JUnit 4.The problem is how these method are implemented: the description instance only stores a single string that combines the name of the class and method (or feature and scenario in case of cucumber). Brackets are used to separate the name of the class from the name of the method, the resulting string looks like this:
MethodName(ClassName).The methods' implementation uses a regex to split the string into parts, and it doesn't work correctly if any of the parts contains bracket characters.
To circumvent this, a separate utility method was implemented, that counts opening and closing brackets to determine where the class name ends.
Contributor Checklist
type:and (comp:orinst:) labels in addition to any usefull labelsclose,fixor any linking keywords when referencing an issue.Use
solvesinstead, and assign the PR milestone to the issueJira ticket: CIVIS-10212