-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[🍒 7435] Fix Cucumber JUnit 4 instrumentation to correctly handle fea…
…ture and scenario names with brackets (#7447)
- Loading branch information
1 parent
e4d2a06
commit 4f97ed1
Showing
7 changed files
with
229 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
10 changes: 10 additions & 0 deletions
10
...ber-junit-4/src/test/resources/org/example/cucumber/calculator/name_with_brackets.feature
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@foo | ||
Feature: This (Name) Has Bracket Characters | ||
|
||
Background: A Calculator | ||
Given a calculator I just turned on | ||
|
||
Scenario: Addition (Has) Brackets Too | ||
# Try to change one of the values below to provoke a failure | ||
When I add 4 and 5 | ||
Then the result is 9 |
8 changes: 8 additions & 0 deletions
8
...tion/junit-4.10/cucumber-junit-4/src/test/resources/test-name-with-brackets/coverages.ftl
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[ { | ||
"test_session_id" : ${content_test_session_id}, | ||
"test_suite_id" : ${content_test_suite_id}, | ||
"span_id" : ${content_span_id}, | ||
"files" : [ { | ||
"filename" : "org/example/cucumber/calculator/name_with_brackets.feature" | ||
} ] | ||
} ] |
151 changes: 151 additions & 0 deletions
151
...ntation/junit-4.10/cucumber-junit-4/src/test/resources/test-name-with-brackets/events.ftl
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
[ { | ||
"type" : "test_suite_end", | ||
"version" : 1, | ||
"content" : { | ||
"test_session_id" : ${content_test_session_id}, | ||
"test_module_id" : ${content_test_module_id}, | ||
"test_suite_id" : ${content_test_suite_id}, | ||
"service" : "worker.org.gradle.process.internal.worker.gradleworkermain", | ||
"name" : "junit.test_suite", | ||
"resource" : "classpath:org/example/cucumber/calculator/name_with_brackets.feature:This (Name) Has Bracket Characters", | ||
"start" : ${content_start}, | ||
"duration" : ${content_duration}, | ||
"error" : 0, | ||
"metrics" : { }, | ||
"meta" : { | ||
"test.type" : "test", | ||
"os.architecture" : ${content_meta_os_architecture}, | ||
"test.module" : "cucumber-junit-4", | ||
"test.status" : "pass", | ||
"runtime.name" : ${content_meta_runtime_name}, | ||
"runtime.vendor" : ${content_meta_runtime_vendor}, | ||
"env" : "none", | ||
"os.platform" : ${content_meta_os_platform}, | ||
"dummy_ci_tag" : "dummy_ci_tag_value", | ||
"os.version" : ${content_meta_os_version}, | ||
"library_version" : ${content_meta_library_version}, | ||
"component" : "junit", | ||
"span.kind" : "test_suite_end", | ||
"test.suite" : "classpath:org/example/cucumber/calculator/name_with_brackets.feature:This (Name) Has Bracket Characters", | ||
"runtime.version" : ${content_meta_runtime_version}, | ||
"test.framework_version" : ${content_meta_test_framework_version}, | ||
"test.framework" : "cucumber" | ||
} | ||
} | ||
}, { | ||
"type" : "test", | ||
"version" : 2, | ||
"content" : { | ||
"trace_id" : ${content_trace_id}, | ||
"span_id" : ${content_span_id}, | ||
"parent_id" : ${content_parent_id}, | ||
"test_session_id" : ${content_test_session_id}, | ||
"test_module_id" : ${content_test_module_id}, | ||
"test_suite_id" : ${content_test_suite_id}, | ||
"service" : "worker.org.gradle.process.internal.worker.gradleworkermain", | ||
"name" : "junit.test", | ||
"resource" : "classpath:org/example/cucumber/calculator/name_with_brackets.feature:This (Name) Has Bracket Characters.Addition (Has) Brackets Too", | ||
"start" : ${content_start_2}, | ||
"duration" : ${content_duration_2}, | ||
"error" : 0, | ||
"metrics" : { | ||
"process_id" : ${content_metrics_process_id}, | ||
"_dd.profiling.enabled" : 0, | ||
"_dd.trace_span_attribute_schema" : 0 | ||
}, | ||
"meta" : { | ||
"os.architecture" : ${content_meta_os_architecture}, | ||
"test.module" : "cucumber-junit-4", | ||
"test.status" : "pass", | ||
"language" : "jvm", | ||
"runtime.name" : ${content_meta_runtime_name}, | ||
"os.platform" : ${content_meta_os_platform}, | ||
"os.version" : ${content_meta_os_version}, | ||
"library_version" : ${content_meta_library_version}, | ||
"test.name" : "Addition (Has) Brackets Too", | ||
"span.kind" : "test", | ||
"test.suite" : "classpath:org/example/cucumber/calculator/name_with_brackets.feature:This (Name) Has Bracket Characters", | ||
"runtime.version" : ${content_meta_runtime_version}, | ||
"runtime-id" : ${content_meta_runtime_id}, | ||
"test.type" : "test", | ||
"test.traits" : "{\"category\":[\"foo\"]}", | ||
"runtime.vendor" : ${content_meta_runtime_vendor}, | ||
"env" : "none", | ||
"dummy_ci_tag" : "dummy_ci_tag_value", | ||
"component" : "junit", | ||
"_dd.profiling.ctx" : "test", | ||
"test.framework_version" : ${content_meta_test_framework_version}, | ||
"test.framework" : "cucumber" | ||
} | ||
} | ||
}, { | ||
"type" : "test_session_end", | ||
"version" : 1, | ||
"content" : { | ||
"test_session_id" : ${content_test_session_id}, | ||
"service" : "worker.org.gradle.process.internal.worker.gradleworkermain", | ||
"name" : "junit.test_session", | ||
"resource" : "cucumber-junit-4", | ||
"start" : ${content_start_3}, | ||
"duration" : ${content_duration_3}, | ||
"error" : 0, | ||
"metrics" : { | ||
"process_id" : ${content_metrics_process_id}, | ||
"_dd.profiling.enabled" : 0, | ||
"_dd.trace_span_attribute_schema" : 0 | ||
}, | ||
"meta" : { | ||
"test.type" : "test", | ||
"os.architecture" : ${content_meta_os_architecture}, | ||
"test.status" : "pass", | ||
"language" : "jvm", | ||
"runtime.name" : ${content_meta_runtime_name}, | ||
"runtime.vendor" : ${content_meta_runtime_vendor}, | ||
"env" : "none", | ||
"os.platform" : ${content_meta_os_platform}, | ||
"dummy_ci_tag" : "dummy_ci_tag_value", | ||
"os.version" : ${content_meta_os_version}, | ||
"library_version" : ${content_meta_library_version}, | ||
"component" : "junit", | ||
"_dd.profiling.ctx" : "test", | ||
"span.kind" : "test_session_end", | ||
"runtime.version" : ${content_meta_runtime_version}, | ||
"runtime-id" : ${content_meta_runtime_id}, | ||
"test.command" : "cucumber-junit-4", | ||
"test.framework_version" : ${content_meta_test_framework_version}, | ||
"test.framework" : "cucumber" | ||
} | ||
} | ||
}, { | ||
"type" : "test_module_end", | ||
"version" : 1, | ||
"content" : { | ||
"test_session_id" : ${content_test_session_id}, | ||
"test_module_id" : ${content_test_module_id}, | ||
"service" : "worker.org.gradle.process.internal.worker.gradleworkermain", | ||
"name" : "junit.test_module", | ||
"resource" : "cucumber-junit-4", | ||
"start" : ${content_start_4}, | ||
"duration" : ${content_duration_4}, | ||
"error" : 0, | ||
"metrics" : { }, | ||
"meta" : { | ||
"test.type" : "test", | ||
"os.architecture" : ${content_meta_os_architecture}, | ||
"test.module" : "cucumber-junit-4", | ||
"test.status" : "pass", | ||
"runtime.name" : ${content_meta_runtime_name}, | ||
"runtime.vendor" : ${content_meta_runtime_vendor}, | ||
"env" : "none", | ||
"os.platform" : ${content_meta_os_platform}, | ||
"dummy_ci_tag" : "dummy_ci_tag_value", | ||
"os.version" : ${content_meta_os_version}, | ||
"library_version" : ${content_meta_library_version}, | ||
"component" : "junit", | ||
"span.kind" : "test_module_end", | ||
"runtime.version" : ${content_meta_runtime_version}, | ||
"test.framework_version" : ${content_meta_test_framework_version}, | ||
"test.framework" : "cucumber" | ||
} | ||
} | ||
} ] |