Skip to content

Commit 96efead

Browse files
author
Robert Bartoszewski
committed
Fixed E2E tests
1 parent 4ea0fab commit 96efead

14 files changed

+166
-268
lines changed

features/default/attributes.feature

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ Feature: Spans with custom attributes
22

33
Scenario: Set attributes in a span
44
Given I run "SetAttributesScenario"
5-
And I wait to receive at least 1 span
6-
* the trace "Bugsnag-Span-Sampling" header equals "1:1"
5+
And I wait to receive a span named "SetAttributesScenario"
6+
* the trace "Bugsnag-Span-Sampling" header matches the regex "^1:\d{1,2}$"
77
* the trace "Bugsnag-Sent-At" header matches the regex "^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\dZ$"
8-
* a span field "name" equals "SetAttributesScenario"
98
* a span string attribute "a" equals "xyz"
109
* every span bool attribute "b" does not exist
1110
* every span bool attribute "d" does not exist
@@ -19,10 +18,9 @@ Feature: Spans with custom attributes
1918

2019
Scenario: Set attributes in a span with limits set
2120
Given I run "SetAttributesWithLimitsScenario"
22-
And I wait to receive at least 1 span
23-
* the trace "Bugsnag-Span-Sampling" header equals "1:1"
21+
And I wait to receive a span named "SetAttributesWithLimitsScenario"
22+
* the trace "Bugsnag-Span-Sampling" header matches the regex "^1:\d{1,2}$"
2423
* the trace "Bugsnag-Sent-At" header matches the regex "^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\dZ$"
25-
* a span field "name" equals "SetAttributesWithLimitsScenario"
2624
* a span string attribute "a" equals "1234567890*** 1 CHARS TRUNCATED"
2725
* a span array attribute "b" contains the integer value 1 at index 0
2826
* a span array attribute "b" contains the integer value 2 at index 1
@@ -31,8 +29,7 @@ Feature: Spans with custom attributes
3129

3230
Scenario: Set attributes in a span with an attribute count limit set
3331
Given I run "SetAttributeCountLimitScenario"
34-
And I wait to receive at least 1 span
35-
* the trace "Bugsnag-Span-Sampling" header equals "1:1"
32+
And I wait to receive a span named "SetAttributeCountLimitScenario"
33+
* the trace "Bugsnag-Span-Sampling" header matches the regex "^1:\d{1,2}$"
3634
* the trace "Bugsnag-Sent-At" header matches the regex "^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\dZ$"
37-
* a span field "name" equals "SetAttributeCountLimitScenario"
3835
* every span string attribute "a" does not exist

features/default/automatic/automatic_network.feature

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Feature: Automatic network instrumentation spans
8686

8787
Scenario: Automatically start a network span that has a null URL
8888
Given I run "AutoInstrumentNetworkNullURLScenario"
89-
And I wait to receive at least 1 span
89+
And I wait to receive at least 2 spans
9090
Then the trace "Content-Type" header equals "application/json"
9191
* the trace "Bugsnag-Sent-At" header matches the regex "^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\dZ$"
9292
* every span field "parentSpanId" does not exist
@@ -198,10 +198,9 @@ Feature: Automatic network instrumentation spans
198198
# Wait for a long time because there can be a LOT of maze-runner related URL requests before the scenario starts.
199199
And I wait for 20 seconds
200200
# There will actually be any number of requests by this point since we're not filtering at all.
201-
And I wait to receive at least 1 span
201+
And I wait to receive a span named "[HTTP/GET]"
202202
Then the trace "Content-Type" header equals "application/json"
203203
* the trace "Bugsnag-Sent-At" header matches the regex "^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\dZ$"
204-
* a span field "name" equals "[HTTP/GET]"
205204
* every span field "spanId" matches the regex "^[A-Fa-f0-9]{16}$"
206205
* every span field "traceId" matches the regex "^[A-Fa-f0-9]{32}$"
207206
* every span field "kind" equals 3

features/default/automatic/automatic_view_load.feature

Lines changed: 89 additions & 184 deletions
Large diffs are not rendered by default.

features/default/callbacks.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Feature: Setting callbacks
33
Scenario: Set OnStart
44
Given I run "OnStartCallbackScenario"
55
And I wait for exactly 1 span
6-
* the trace "Bugsnag-Span-Sampling" header equals "1:1"
6+
* the trace "Bugsnag-Span-Sampling" header matches the regex "^1:\d{1,2}$"
77
* the trace "Bugsnag-Sent-At" header matches the regex "^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\dZ$"
88
* a span field "name" equals "OnStartCallbackScenario"
99
* a span bool attribute "start_callback_1" is true
@@ -12,6 +12,6 @@ Feature: Setting callbacks
1212
Scenario: Set OnEnd
1313
Given I run "OnEndCallbackScenario"
1414
And I wait for exactly 1 span
15-
* the trace "Bugsnag-Span-Sampling" header equals "1:1"
15+
* the trace "Bugsnag-Span-Sampling" header matches the regex "^1:\d{1,2}$"
1616
* the trace "Bugsnag-Sent-At" header matches the regex "^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\dZ$"
1717
* a span field "name" equals "OnEndCallbackScenario"

features/default/conditions.feature

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Feature: Conditions
22

33
Scenario: Manually creating and ending conditions
44
Given I run "ConditionsBasicScenario"
5-
And I wait to receive at least 1 span
5+
And I wait to receive a span named "ConditionsBasicScenario"
66
Then the trace "Content-Type" header equals "application/json"
77
* the trace "Bugsnag-Integrity" header matches the regex "^sha1 [A-Fa-f0-9]{40}$"
88
* the trace "Bugsnag-Span-Sampling" header matches the regex "^1:\d{1,2}$"
@@ -19,7 +19,7 @@ Feature: Conditions
1919

2020
Scenario: Span can be blocked again after being ended as long as it is still blocked
2121
Given I run "ConditionsBlockingBlockedEndedSpanScenario"
22-
And I wait to receive at least 1 span
22+
And I wait to receive a span named "ConditionsBlockingBlockedEndedSpanScenario"
2323
Then the trace "Content-Type" header equals "application/json"
2424
* the trace "Bugsnag-Integrity" header matches the regex "^sha1 [A-Fa-f0-9]{40}$"
2525
* the trace "Bugsnag-Span-Sampling" header matches the regex "^1:\d{1,2}$"
@@ -36,7 +36,7 @@ Feature: Conditions
3636

3737
Scenario: Condition should not override endTime to an earlier time
3838
Given I run "ConditionsOverrideEndTimeBackwardsScenario"
39-
And I wait to receive at least 1 span
39+
And I wait to receive a span named "ConditionsOverrideEndTimeBackwardsScenario"
4040
Then the trace "Content-Type" header equals "application/json"
4141
* the trace "Bugsnag-Integrity" header matches the regex "^sha1 [A-Fa-f0-9]{40}$"
4242
* the trace "Bugsnag-Span-Sampling" header matches the regex "^1:\d{1,2}$"
@@ -53,12 +53,11 @@ Feature: Conditions
5353

5454
Scenario: Span Conditions - condition closed
5555
Given I run "SpanConditionsSimpleConditionScenario"
56-
And I wait to receive at least 2 spans
56+
And I wait to receive a span named "SpanConditionsSimpleConditionScenarioSpan1"
57+
And I wait to receive a span named "SpanConditionsSimpleConditionScenarioSpan2"
5758
Then the trace "Content-Type" header equals "application/json"
58-
* the trace "Bugsnag-Span-Sampling" header equals "1:2"
59+
* the trace "Bugsnag-Span-Sampling" header matches the regex "^1:\d{1,2}$"
5960
* the trace "Bugsnag-Sent-At" header matches the regex "^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\dZ$"
60-
* a span field "name" equals "SpanConditionsSimpleConditionScenarioSpan1"
61-
* a span field "name" equals "SpanConditionsSimpleConditionScenarioSpan2"
6261
* every span field "spanId" matches the regex "^[A-Fa-f0-9]{16}$"
6362
* every span field "traceId" matches the regex "^[A-Fa-f0-9]{32}$"
6463
* every span field "kind" equals 1
@@ -69,12 +68,11 @@ Feature: Conditions
6968

7069
Scenario: Span Conditions - condition timed out
7170
Given I run "SpanConditionsConditionTimedOutScenario"
72-
And I wait to receive at least 2 spans
71+
And I wait to receive a span named "SpanConditionsConditionTimedOutScenarioSpan1"
72+
And I wait to receive a span named "SpanConditionsConditionTimedOutScenarioSpan2"
7373
Then the trace "Content-Type" header equals "application/json"
74-
* the trace "Bugsnag-Span-Sampling" header equals "1:2"
74+
* the trace "Bugsnag-Span-Sampling" header matches the regex "^1:\d{1,2}$"
7575
* the trace "Bugsnag-Sent-At" header matches the regex "^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\dZ$"
76-
* a span field "name" equals "SpanConditionsConditionTimedOutScenarioSpan1"
77-
* a span field "name" equals "SpanConditionsConditionTimedOutScenarioSpan2"
7876
* every span field "spanId" matches the regex "^[A-Fa-f0-9]{16}$"
7977
* every span field "traceId" matches the regex "^[A-Fa-f0-9]{32}$"
8078
* every span field "kind" equals 1
@@ -84,13 +82,12 @@ Feature: Conditions
8482

8583
Scenario: Span Conditions - multiple conditions
8684
Given I run "SpanConditionsMultipleConditionsScenario"
87-
And I wait to receive at least 3 spans
85+
And I wait to receive a span named "SpanConditionsMultipleConditionsScenarioSpan1"
86+
And I wait to receive a span named "SpanConditionsMultipleConditionsScenarioSpan2"
87+
And I wait to receive a span named "SpanConditionsMultipleConditionsScenarioSpan3"
8888
Then the trace "Content-Type" header equals "application/json"
89-
* the trace "Bugsnag-Span-Sampling" header equals "1:3"
89+
* the trace "Bugsnag-Span-Sampling" header matches the regex "^1:\d{1,2}$"
9090
* the trace "Bugsnag-Sent-At" header matches the regex "^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\dZ$"
91-
* a span field "name" equals "SpanConditionsMultipleConditionsScenarioSpan1"
92-
* a span field "name" equals "SpanConditionsMultipleConditionsScenarioSpan2"
93-
* a span field "name" equals "SpanConditionsMultipleConditionsScenarioSpan3"
9491
* every span field "spanId" matches the regex "^[A-Fa-f0-9]{16}$"
9592
* every span field "traceId" matches the regex "^[A-Fa-f0-9]{32}$"
9693
* every span field "kind" equals 1
@@ -101,12 +98,11 @@ Feature: Conditions
10198

10299
Scenario: Span Conditions - blocking blocked ended span
103100
Given I run "SpanConditionsBlockedSpanScenario"
104-
And I wait to receive at least 1 span
101+
And I wait to receive a span named "SpanConditionsBlockedSpanScenarioSpan1"
102+
And I wait to receive a span named "SpanConditionsBlockedSpanScenarioSpan2"
105103
Then the trace "Content-Type" header equals "application/json"
106-
* the trace "Bugsnag-Span-Sampling" header equals "1:2"
104+
* the trace "Bugsnag-Span-Sampling" header matches the regex "^1:\d{1,2}$"
107105
* the trace "Bugsnag-Sent-At" header matches the regex "^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\dZ$"
108-
* a span field "name" equals "SpanConditionsBlockedSpanScenarioSpan1"
109-
* a span field "name" equals "SpanConditionsBlockedSpanScenarioSpan2"
110106
* every span field "spanId" matches the regex "^[A-Fa-f0-9]{16}$"
111107
* every span field "traceId" matches the regex "^[A-Fa-f0-9]{32}$"
112108
* every span field "kind" equals 1

features/default/early_spans.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Feature: Early spans
2525
Given I run "ModifyEarlySpansScenario"
2626
And I wait for exactly 5 spans
2727
Then the trace "Content-Type" header equals "application/json"
28-
* the trace "Bugsnag-Span-Sampling" header equals "1:5"
28+
* the trace "Bugsnag-Span-Sampling" header matches the regex "^1:\d{1,2}$"
2929
* the trace "Bugsnag-Sent-At" header matches the regex "^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\dZ$"
3030
* a span field "name" equals "[AppStart/iOSCold]"
3131
* a span field "name" equals "[AppStartPhase/App launching - pre main()]"

features/default/limits.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Feature: Checking payloads limits
66
And I wait for exactly 1 span
77
Then the trace "Content-Type" header equals "application/json"
88
* the trace "Bugsnag-Integrity" header matches the regex "^sha1 [A-Fa-f0-9]{40}$"
9-
* the trace "Bugsnag-Span-Sampling" header equals "1:1"
9+
* the trace "Bugsnag-Span-Sampling" header matches the regex "^1:\d{1,2}$"
1010
* the trace "Bugsnag-Sent-At" header matches the regex "^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\dZ$"
1111
* the trace "Bugsnag-Uncompressed-Content-Length" header matches the regex "^[0-9]+$"
1212
* every span field "name" equals "MaxPayloadSizeScenario"

features/default/manual_spans.feature

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ Feature: Manual creation of spans
55
Scenario: Retry a manual span
66
Given I set the HTTP status code for the next requests to 200,500,200,200
77
And I run "RetryScenario"
8-
And I wait to receive at least 1 span
9-
* the trace "Bugsnag-Span-Sampling" header equals "1:1"
8+
And I wait to receive a span named "WillRetry"
9+
* the trace "Bugsnag-Span-Sampling" header matches the regex "^1:\d{1,2}$"
1010
* the trace "Bugsnag-Sent-At" header matches the regex "^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\dZ$"
11-
* a span field "name" equals "WillRetry"
1211
Then I discard the oldest trace
1312
And I invoke "step2"
14-
And I wait to receive at least 2 spans
15-
* a span field "name" equals "WillRetry"
16-
* a span field "name" equals "Success"
13+
And I wait to receive a span named "WillRetry"
14+
And I wait to receive a span named "Success"
1715
* every span bool attribute "bugsnag.span.first_class" is true
1816
* every span string attribute "bugsnag.span.category" equals "custom"
1917

@@ -55,7 +53,7 @@ Feature: Manual creation of spans
5553
And I wait to receive at least 1 span
5654
Then the trace "Content-Type" header equals "application/json"
5755
* the trace "Bugsnag-Integrity" header matches the regex "^sha1 [A-Fa-f0-9]{40}$"
58-
* the trace "Bugsnag-Span-Sampling" header equals "1:1"
56+
* the trace "Bugsnag-Span-Sampling" header matches the regex "^1:\d{1,2}$"
5957
* the trace "Bugsnag-Sent-At" header matches the regex "^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\dZ$"
6058
* every span field "name" equals "ManualSpanEndOnDestroyScenario"
6159
* every span field "spanId" matches the regex "^[A-Fa-f0-9]{16}$"
@@ -84,7 +82,7 @@ Feature: Manual creation of spans
8482
Scenario: Starting and ending a span before starting the SDK
8583
Given I run "ManualSpanBeforeStartScenario"
8684
And I wait to receive at least 1 span
87-
* the trace "Bugsnag-Span-Sampling" header equals "1:1"
85+
* the trace "Bugsnag-Span-Sampling" header matches the regex "^1:\d{1,2}$"
8886
* the trace "Bugsnag-Sent-At" header matches the regex "^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\dZ$"
8987
* every span field "name" equals "BeforeStart"
9088
* every span field "spanId" matches the regex "^[A-Fa-f0-9]{16}$"
@@ -138,7 +136,7 @@ Feature: Manual creation of spans
138136
Scenario: Manually report a UIViewController load span
139137
Given I run "ManualUIViewLoadScenario"
140138
And I wait to receive at least 1 span
141-
* the trace "Bugsnag-Span-Sampling" header equals "1:1"
139+
* the trace "Bugsnag-Span-Sampling" header matches the regex "^1:\d{1,2}$"
142140
* the trace "Bugsnag-Sent-At" header matches the regex "^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\dZ$"
143141
* every span field "name" equals "[ViewLoad/UIKit]/UIViewController"
144142
* every span string attribute "bugsnag.view.name" equals "UIViewController"
@@ -246,22 +244,20 @@ Feature: Manual creation of spans
246244

247245
Scenario: Manually start and end parent and child spans
248246
Given I run "ParentSpanScenario"
249-
And I wait to receive at least 2 spans
247+
And I wait to receive a span named "SpanParent"
248+
And I wait to receive a span named "SpanChild"
250249
Then the trace "Content-Type" header equals "application/json"
250+
* a span named "SpanChild" is a child of span named "SpanParent"
251251
* the trace "Bugsnag-Sent-At" header matches the regex "^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\dZ$"
252252
* the trace payload field "resourceSpans.0.resource" string attribute "service.name" matches the regex "com.bugsnag.fixtures.cocoaperformance(xcframework)?"
253253
* the trace payload field "resourceSpans.0.resource" string attribute "telemetry.sdk.name" equals "bugsnag.performance.cocoa"
254254
* the trace payload field "resourceSpans.0.resource" string attribute "telemetry.sdk.version" matches the regex "[0-9]+\.[0-9]+\.[0-9]+"
255-
* a span field "name" equals "SpanParent"
256-
* a span field "name" equals "SpanChild"
257255
* every span field "spanId" matches the regex "^[A-Fa-f0-9]{16}$"
258256
* every span field "traceId" matches the regex "^[A-Fa-f0-9]{32}$"
259257
* every span field "kind" equals 1
260258
* every span field "startTimeUnixNano" matches the regex "^[0-9]+$"
261259
* every span field "endTimeUnixNano" matches the regex "^[0-9]+$"
262260
* every span bool attribute "bugsnag.span.first_class" is true
263-
# Note: The child span ends up first in the list of spans.
264-
* the trace payload field "resourceSpans.0.scopeSpans.0.spans.0.parentSpanId" matches the regex "^[A-Fa-f0-9]{16}$"
265261

266262
Scenario: Manually start and end child span with a manually defined parent
267263
Given I run "ManualParentSpanScenario"
@@ -331,14 +327,13 @@ Feature: Manual creation of spans
331327

332328
Scenario: Manually start and end a span with nil parent context
333329
Given I run "ManualSpanWithContextParentNilScenario"
334-
And I wait to receive at least 3 spans
330+
And I wait to receive a span named "ManualSpanWithContextParentNilScenario"
331+
And I wait to receive a span named "ManualSpanWithContextParentSet"
332+
And I wait to receive a span named "ShouldNotBeParentSpan"
335333
Then the trace "Content-Type" header equals "application/json"
334+
* a span named "ManualSpanWithContextParentSet" is a child of span named "ManualSpanWithContextParentNilScenario"
335+
* a span named "ManualSpanWithContextParentNilScenario" has no parent
336+
* a span named "ShouldNotBeParentSpan" has no parent
336337
* the trace "Bugsnag-Integrity" header matches the regex "^sha1 [A-Fa-f0-9]{40}$"
337-
* the trace "Bugsnag-Span-Sampling" header equals "1:3"
338+
* the trace "Bugsnag-Span-Sampling" header matches the regex "^1:\d{1,2}$"
338339
* the trace "Bugsnag-Sent-At" header matches the regex "^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\dZ$"
339-
* the trace payload field "resourceSpans.0.scopeSpans.0.spans.0.name" equals "ManualSpanWithContextParentNilScenario"
340-
* the trace payload field "resourceSpans.0.scopeSpans.0.spans.1.name" equals "ManualSpanWithContextParentSet"
341-
* the trace payload field "resourceSpans.0.scopeSpans.0.spans.2.name" equals "ShouldNotBeParentSpan"
342-
* the trace payload field "resourceSpans.0.scopeSpans.0.spans.0.parentSpanId" is null
343-
* the trace payload field "resourceSpans.0.scopeSpans.0.spans.1.parentSpanId" matches the regex "^[A-Fa-f0-9]{16}$"
344-
* the trace payload field "resourceSpans.0.scopeSpans.0.spans.2.parentSpanId" is null

0 commit comments

Comments
 (0)