-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(react-native): test custom attributes on native spans
- Loading branch information
1 parent
5fe86a3
commit d165e50
Showing
2 changed files
with
73 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,70 @@ | ||
@native_integration | ||
Feature: Native Integration | ||
|
||
Scenario: Native Integration | ||
Scenario: First class custom spans are delegated to the native SDK | ||
When I run 'NativeIntegrationScenario' | ||
And I wait to receive 2 spans | ||
Then a span named "Native child span" has a parent named "JS parent span" | ||
And a span named "Native child span" contains the attributes: | ||
| attribute | type | value | | ||
| bugsnag.span.category | stringValue | custom | | ||
| bugsnag.span.first_class | boolValue | true | | ||
| custom.native.attribute | stringValue | Native span attribute | | ||
And a span named "JS parent span" contains the attributes: | ||
| attribute | type | value | | ||
| bugsnag.span.category | stringValue | custom | | ||
| custom.js.attribute | stringValue | JS span attribute | | ||
And I wait to receive 2 sampling requests | ||
And I wait to receive 2 traces | ||
|
||
# JS trace | ||
And the trace payload field "resourceSpans.0.resource" string attribute "service.name" equals "com.bugsnag.fixtures.reactnative.performance" | ||
And the trace payload field "resourceSpans.0.resource" string attribute "telemetry.sdk.name" equals "bugsnag.performance.reactnative" | ||
And the trace payload field "resourceSpans.0.resource" string attribute "device.id" matches the regex "^[a-z0-9-]{20,40}$" | ||
|
||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0.name" equals "JS parent span" | ||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0" double attribute "bugsnag.sampling.p" equals 1.0 | ||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0" string attribute "bugsnag.span.category" equals "custom" | ||
|
||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0" string attribute "custom.string.attribute" equals "test" | ||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0" integer attribute "custom.int.attribute" equals 12345 | ||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0" double attribute "custom.double.attribute" equals 123.45 | ||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0" boolean attribute "custom.boolean.attribute" is true | ||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0" string array attribute "custom.stringarray.attribute" equals the array: | ||
| a | | ||
| b | | ||
| c | | ||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0" integer array attribute "custom.intarray.attribute" equals the array: | ||
| 1 | | ||
| 2 | | ||
| 3 | | ||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0" double array attribute "custom.doublearray.attribute" equals the array: | ||
| 1.1 | | ||
| 2.2 | | ||
| 3.3 | | ||
|
||
Then the trace payload field "resourceSpans.0.resource" string attribute "device.id" is stored as the value "deviceId" | ||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0.spanId" is stored as the value "parentSpanId" | ||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0.traceId" is stored as the value "traceId" | ||
|
||
# Native trace | ||
Then I discard the oldest trace | ||
And the trace payload field "resourceSpans.0.resource" string attribute "service.name" equals "com.bugsnag.fixtures.reactnative.performance" | ||
And the trace payload field "resourceSpans.0.resource" string attribute "telemetry.sdk.name" equals the platform-dependent string: | ||
| ios | bugsnag.performance.cocoa | | ||
| android | bugsnag.performance.android | | ||
|
||
And the trace payload field "resourceSpans.0.resource" string attribute "device.id" equals the stored value "deviceId" | ||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0.name" equals "Native child span" | ||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0.parentSpanId" equals the stored value "spanId" | ||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0.traceId" equals the stored value "traceId" | ||
|
||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0" double attribute "bugsnag.sampling.p" equals 1.0 | ||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0" string attribute "bugsnag.span.category" equals "custom" | ||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0" boolean attribute "bugsnag.span.first_class" is true | ||
|
||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0" string attribute "custom.string.attribute" equals "test" | ||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0" integer attribute "custom.int.attribute" equals 12345 | ||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0" double attribute "custom.double.attribute" equals 123.45 | ||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0" boolean attribute "custom.boolean.attribute" is true | ||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0" string array attribute "custom.stringarray.attribute" equals the array: | ||
| a | | ||
| b | | ||
| c | | ||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0" integer array attribute "custom.intarray.attribute" equals the array: | ||
| 1 | | ||
| 2 | | ||
| 3 | | ||
And the trace payload field "resourceSpans.0.scopeSpans.0.spans.0" double array attribute "custom.doublearray.attribute" equals the array: | ||
| 1.1 | | ||
| 2.2 | | ||
| 3.3 | |