-
Notifications
You must be signed in to change notification settings - Fork 257
Expand file tree
/
Copy pathfeature_flags.feature
More file actions
98 lines (94 loc) · 4.66 KB
/
feature_flags.feature
File metadata and controls
98 lines (94 loc) · 4.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Feature: feature flags
Background:
Given I store the api key in the environment variable "BUGSNAG_API_KEY"
And I store the notify endpoint in the environment variable "BUGSNAG_NOTIFY_ENDPOINT"
And I store the sessions endpoint in the environment variable "BUGSNAG_SESSIONS_ENDPOINT"
And I store the logs endpoint in the environment variable "BUGSNAG_LOGS_ENDPOINT"
Scenario: adding feature flags for an unhandled error
Given I start the service "express"
And I wait for the host "express" to open port "80"
When I POST the data "a=1&b=2&c=3&d=4" to the URL "http://express/features/unhandled" with the content type "application/x-www-form-urlencoded"
And I wait to receive an error
Then the error is valid for the error reporting API version "4" for the "Bugsnag Node" notifier
And the event "unhandled" is true
And the event "severity" equals "error"
And the exception "errorClass" equals "Error"
And the exception "message" equals "oh no"
And the exception "type" equals "nodejs"
And the "file" of stack frame 0 equals "scenarios/app.js"
And the event "request.httpMethod" equals "POST"
And the event contains the following feature flags:
| featureFlag | variant |
| from config 1 | 1234 |
| from config 2 | |
| a | 1 |
| b | 2 |
| c | 3 |
| d | 4 |
# ensure each request can have its own set of feature flags
When I discard the oldest error
And I POST the data "x=9&y=8&z=7" to the URL "http://express/features/unhandled" with the content type "application/x-www-form-urlencoded"
And I wait to receive an error
And the event contains the following feature flags:
| featureFlag | variant |
| from config 1 | 1234 |
| from config 2 | |
| x | 9 |
| y | 8 |
| z | 7 |
Scenario: adding feature flags for a handled error
Given I start the service "express"
And I wait for the host "express" to open port "80"
When I POST the data "a=1&b=2&c=3&d=4" to the URL "http://express/features/handled" with the content type "application/x-www-form-urlencoded"
And I wait to receive an error
Then the error is valid for the error reporting API version "4" for the "Bugsnag Node" notifier
And the event "unhandled" is false
And the event "severity" equals "warning"
And the exception "errorClass" equals "Error"
And the exception "message" equals "oh no"
And the exception "type" equals "nodejs"
And the "file" of stack frame 0 equals "scenarios/app.js"
And the event "request.httpMethod" equals "POST"
And the event contains the following feature flags:
| featureFlag | variant |
| from config 1 | 1234 |
| from config 2 | |
| a | 1 |
| b | 2 |
| c | 3 |
| d | 4 |
# ensure each request can have its own set of feature flags
When I discard the oldest error
And I POST the data "x=9&y=8&z=7" to the URL "http://express/features/handled" with the content type "application/x-www-form-urlencoded"
And I wait to receive an error
And the event contains the following feature flags:
| featureFlag | variant |
| from config 1 | 1234 |
| from config 2 | |
| x | 9 |
| y | 8 |
| z | 7 |
Scenario: clearing all feature flags doesn't affect subsequent requests
Given I start the service "express"
And I wait for the host "express" to open port "80"
When I POST the data "a=1&b=2&c=3&d=4&clearAllFeatureFlags" to the URL "http://express/features/unhandled" with the content type "application/x-www-form-urlencoded"
And I wait to receive an error
Then the error is valid for the error reporting API version "4" for the "Bugsnag Node" notifier
And the event "unhandled" is true
And the event "severity" equals "error"
And the exception "errorClass" equals "Error"
And the exception "message" equals "oh no"
And the exception "type" equals "nodejs"
And the "file" of stack frame 0 equals "scenarios/app.js"
And the event "request.httpMethod" equals "POST"
And the event has no feature flags
When I discard the oldest error
And I POST the data "x=9&y=8&z=7" to the URL "http://express/features/unhandled" with the content type "application/x-www-form-urlencoded"
And I wait to receive an error
And the event contains the following feature flags:
| featureFlag | variant |
| from config 1 | 1234 |
| from config 2 | |
| x | 9 |
| y | 8 |
| z | 7 |