-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Cucumber JUnit 4 instrumentation to support empty scenario names (#…
- Loading branch information
1 parent
4679c0a
commit 77c6fbe
Showing
7 changed files
with
350 additions
and
4 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
10 changes: 10 additions & 0 deletions
10
...er-junit-4/src/test/resources/org/example/cucumber/calculator/empty_scenario_name.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: | ||
|
||
Background: A Calculator | ||
Given a calculator I just turned on | ||
|
||
Scenario: | ||
# 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
...tation/junit-4.10/cucumber-junit-4/src/test/resources/test-empty-name-5.4.0/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/empty_scenario_name.feature" | ||
} ] | ||
} ] |
151 changes: 151 additions & 0 deletions
151
...mentation/junit-4.10/cucumber-junit-4/src/test/resources/test-empty-name-5.4.0/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/empty_scenario_name.feature:EMPTY_NAME", | ||
"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/empty_scenario_name.feature:EMPTY_NAME", | ||
"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/empty_scenario_name.feature:EMPTY_NAME.EMPTY_NAME", | ||
"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" : "EMPTY_NAME", | ||
"span.kind" : "test", | ||
"test.suite" : "classpath:org/example/cucumber/calculator/empty_scenario_name.feature:EMPTY_NAME", | ||
"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" | ||
} | ||
} | ||
} ] |
8 changes: 8 additions & 0 deletions
8
...ation/junit-4.10/cucumber-junit-4/src/test/resources/test-empty-name-latest/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/empty_scenario_name.feature" | ||
} ] | ||
} ] |
151 changes: 151 additions & 0 deletions
151
...entation/junit-4.10/cucumber-junit-4/src/test/resources/test-empty-name-latest/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/empty_scenario_name.feature:EMPTY_NAME", | ||
"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/empty_scenario_name.feature:EMPTY_NAME", | ||
"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/empty_scenario_name.feature:EMPTY_NAME.LINE:7", | ||
"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" : "LINE:7", | ||
"span.kind" : "test", | ||
"test.suite" : "classpath:org/example/cucumber/calculator/empty_scenario_name.feature:EMPTY_NAME", | ||
"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" | ||
} | ||
} | ||
} ] |