-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix handling skipped features in Karate
- Loading branch information
1 parent
329acac
commit a638e84
Showing
6 changed files
with
144 additions
and
6 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
19 changes: 19 additions & 0 deletions
19
dd-java-agent/instrumentation/karate/src/test/java/org/example/TestSkippedFeatureKarate.java
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,19 @@ | ||
package org.example; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import com.intuit.karate.Results; | ||
import com.intuit.karate.Runner; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class TestSkippedFeatureKarate { | ||
|
||
@Test | ||
void testParallel() { | ||
Results results = | ||
Runner.path("classpath:org/example/test_succeed.feature") | ||
.systemProperty("karate.options", "--tags ~@foo") | ||
.parallel(1); | ||
assertEquals(0, results.getFailCount(), results.getErrorMessages()); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
dd-java-agent/instrumentation/karate/src/test/resources/test-skipped-feature/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 @@ | ||
[ ] |
106 changes: 106 additions & 0 deletions
106
dd-java-agent/instrumentation/karate/src/test/resources/test-skipped-feature/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,106 @@ | ||
[ { | ||
"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" : "karate.test_suite", | ||
"resource" : "[org/example/test_succeed] test succeed", | ||
"start" : ${content_start}, | ||
"duration" : ${content_duration}, | ||
"error" : 0, | ||
"metrics" : { }, | ||
"meta" : { | ||
"test.type" : "test", | ||
"os.architecture" : ${content_meta_os_architecture}, | ||
"test.module" : "karate", | ||
"test.status" : "skip", | ||
"test.traits" : "{\"category\":[\"foo\"]}", | ||
"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" : "karate", | ||
"span.kind" : "test_suite_end", | ||
"test.suite" : "[org/example/test_succeed] test succeed", | ||
"runtime.version" : ${content_meta_runtime_version}, | ||
"test.framework_version" : ${content_meta_test_framework_version}, | ||
"test.framework" : "karate" | ||
} | ||
} | ||
}, { | ||
"type" : "test_session_end", | ||
"version" : 1, | ||
"content" : { | ||
"test_session_id" : ${content_test_session_id}, | ||
"service" : "worker.org.gradle.process.internal.worker.gradleworkermain", | ||
"name" : "karate.test_session", | ||
"resource" : "karate", | ||
"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" : { | ||
"test.type" : "test", | ||
"os.architecture" : ${content_meta_os_architecture}, | ||
"test.status" : "skip", | ||
"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" : "karate", | ||
"_dd.profiling.ctx" : "test", | ||
"span.kind" : "test_session_end", | ||
"runtime.version" : ${content_meta_runtime_version}, | ||
"runtime-id" : ${content_meta_runtime_id}, | ||
"test.command" : "karate", | ||
"test.framework_version" : ${content_meta_test_framework_version}, | ||
"test.framework" : "karate" | ||
} | ||
} | ||
}, { | ||
"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" : "karate.test_module", | ||
"resource" : "karate", | ||
"start" : ${content_start_3}, | ||
"duration" : ${content_duration_3}, | ||
"error" : 0, | ||
"metrics" : { }, | ||
"meta" : { | ||
"test.type" : "test", | ||
"os.architecture" : ${content_meta_os_architecture}, | ||
"test.module" : "karate", | ||
"test.status" : "skip", | ||
"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" : "karate", | ||
"span.kind" : "test_module_end", | ||
"runtime.version" : ${content_meta_runtime_version}, | ||
"test.framework_version" : ${content_meta_test_framework_version}, | ||
"test.framework" : "karate" | ||
} | ||
} | ||
} ] |