-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathnode-upload-one.feature
280 lines (268 loc) · 14.5 KB
/
node-upload-one.feature
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
Feature: Node source map upload one
Scenario: Basic success case (webpack)
When I run the service "single-source-map-webpack" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--app-version 2.0.0
--source-map dist/main.js.map
--bundle dist/main.js
--endpoint http://maze-runner:9339
"""
And I wait to receive 1 sourcemap
Then the sourcemap payload field "apiKey" equals "123"
And the sourcemap payload field "appVersion" equals "2.0.0"
And the sourcemap payload field "overwrite" is null
And the sourcemap payload field "minifiedUrl" equals "dist/main.js"
And the sourcemap payload field "sourceMap" matches the expected source map for "single-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the expected minified file for "single-source-map-webpack"
And the Content-Type header is valid multipart form-data
And the last run docker command exited successfully
Scenario: Basic success case (babel)
When I run the service "single-source-map-babel-node" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--app-version 2.0.0
--source-map dist/compiled.js.map
--bundle dist/compiled.js
--endpoint http://maze-runner:9339
"""
And I wait to receive 1 sourcemap
Then the sourcemap payload field "apiKey" equals "123"
And the sourcemap payload field "appVersion" equals "2.0.0"
And the sourcemap payload field "overwrite" is null
And the sourcemap payload field "minifiedUrl" equals "dist/compiled.js"
And the sourcemap payload field "sourceMap" matches the expected source map for "single-source-map-babel-node"
And the sourcemap payload field "minifiedFile" matches the expected minified file for "single-source-map-babel-node"
And the Content-Type header is valid multipart form-data
And the last run docker command exited successfully
Scenario: Basic success case (typescript)
When I run the service "single-source-map-typescript" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--app-version 2.0.0
--source-map dist/out.js.map
--bundle dist/out.js
--endpoint http://maze-runner:9339
"""
And I wait to receive 1 sourcemap
Then the sourcemap payload field "apiKey" equals "123"
And the sourcemap payload field "appVersion" equals "2.0.0"
And the sourcemap payload field "overwrite" is null
And the sourcemap payload field "minifiedUrl" equals "dist/out.js"
And the sourcemap payload field "sourceMap" matches the expected source map for "single-source-map-typescript"
And the sourcemap payload field "minifiedFile" matches the expected minified file for "single-source-map-typescript"
And the Content-Type header is valid multipart form-data
And the last run docker command exited successfully
Scenario: Detected app version
When I run the service "single-source-map-webpack" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--detect-app-version
--source-map dist/main.js.map
--bundle dist/main.js
--endpoint http://maze-runner:9339
"""
And I wait to receive 1 sourcemap
Then the sourcemap payload field "apiKey" equals "123"
And the sourcemap payload field "appVersion" equals "1.2.3"
And the sourcemap payload field "overwrite" is null
And the sourcemap payload field "minifiedUrl" equals "dist/main.js"
And the sourcemap payload field "sourceMap" matches the expected source map for "single-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the expected minified file for "single-source-map-webpack"
And the Content-Type header is valid multipart form-data
And the last run docker command exited successfully
Scenario: codeBundleId support
When I run the service "single-source-map-webpack" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--code-bundle-id r0126
--source-map dist/main.js.map
--bundle dist/main.js
--endpoint http://maze-runner:9339
"""
And I wait to receive 1 sourcemap
Then the sourcemap payload field "apiKey" equals "123"
And the sourcemap payload field "codeBundleId" equals "r0126"
And the sourcemap payload field "overwrite" is null
And the sourcemap payload field "minifiedUrl" equals "dist/main.js"
And the sourcemap payload field "sourceMap" matches the expected source map for "single-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the expected minified file for "single-source-map-webpack"
And the Content-Type header is valid multipart form-data
And the last run docker command exited successfully
Scenario: Overwrite enabled
When I run the service "single-source-map-webpack" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--app-version 2.0.0
--source-map dist/main.js.map
--bundle dist/main.js
--endpoint http://maze-runner:9339
--overwrite
"""
And I wait to receive 1 sourcemap
Then the sourcemap payload field "apiKey" equals "123"
And the sourcemap payload field "appVersion" equals "2.0.0"
And the sourcemap payload field "overwrite" equals "true"
And the sourcemap payload field "minifiedUrl" equals "dist/main.js"
And the sourcemap payload field "sourceMap" matches the expected source map for "single-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the expected minified file for "single-source-map-webpack"
And the Content-Type header is valid multipart form-data
And the last run docker command exited successfully
Scenario: A request will be retried on a server failure (500 status code)
When I set the HTTP status code for the next request to 500
And I run the service "single-source-map-webpack" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--app-version 2.0.0
--source-map dist/main.js.map
--bundle dist/main.js
--endpoint http://maze-runner:9339
"""
And I wait to receive 2 sourcemaps
Then the last run docker command exited successfully
And the Content-Type header is valid multipart form-data for all requests
And the sourcemap payload field "apiKey" equals "123" for all requests
And the sourcemap payload field "appVersion" equals "2.0.0" for all requests
And the sourcemap payload field "overwrite" is null for all requests
And the sourcemap payload field "minifiedUrl" equals "dist/main.js" for all requests
And the sourcemap payload field "sourceMap" matches the expected source map for "single-source-map-webpack" for all requests
And the sourcemap payload field "minifiedFile" matches the expected minified file for "single-source-map-webpack" for all requests
Scenario: A request will be retried up to 5 times on a server failure (500 status code)
When I set the HTTP status code to 500
And I run the service "single-source-map-webpack" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--app-version 2.0.0
--source-map dist/main.js.map
--bundle dist/main.js
--endpoint http://maze-runner:9339
"""
And I wait to receive 5 sourcemaps
Then the last run docker command did not exit successfully
And the last run docker command output "A server side error occurred while processing the upload."
And the last run docker command output "HTTP status 500 received from upload API"
And the Content-Type header is valid multipart form-data for all requests
And the sourcemap payload field "apiKey" equals "123" for all requests
And the sourcemap payload field "appVersion" equals "2.0.0" for all requests
And the sourcemap payload field "overwrite" is null for all requests
And the sourcemap payload field "minifiedUrl" equals "dist/main.js" for all requests
And the sourcemap payload field "sourceMap" matches the expected source map for "single-source-map-webpack" for all requests
And the sourcemap payload field "minifiedFile" matches the expected minified file for "single-source-map-webpack" for all requests
Scenario: A request will not be retried if the API key is invalid (401 status code)
When I set the HTTP status code for the next request to 401
And I run the service "single-source-map-webpack" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--app-version 2.0.0
--source-map dist/main.js.map
--bundle dist/main.js
--endpoint http://maze-runner:9339
"""
And I wait to receive 1 sourcemap
Then the last run docker command did not exit successfully
And the last run docker command output "The provided API key was invalid."
And the last run docker command output "HTTP status 401 received from upload API"
And the sourcemap payload field "apiKey" equals "123"
And the sourcemap payload field "appVersion" equals "2.0.0"
And the sourcemap payload field "overwrite" is null
And the sourcemap payload field "minifiedUrl" equals "dist/main.js" for all requests
And the sourcemap payload field "sourceMap" matches the expected source map for "single-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the expected minified file for "single-source-map-webpack"
And the Content-Type header is valid multipart form-data
Scenario: A request will not be retried if the source map is a duplicate (409 status code)
When I set the HTTP status code for the next request to 409
And I run the service "single-source-map-webpack" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--app-version 2.0.0
--source-map dist/main.js.map
--bundle dist/main.js
--endpoint http://maze-runner:9339
"""
And I wait to receive 1 sourcemap
Then the last run docker command did not exit successfully
And the last run docker command output "A source map matching the same criteria has already been uploaded. If you want to replace it, use the \"overwrite\" flag."
And the last run docker command output "HTTP status 409 received from upload API"
And the sourcemap payload field "apiKey" equals "123"
And the sourcemap payload field "appVersion" equals "2.0.0"
And the sourcemap payload field "overwrite" is null
And the sourcemap payload field "minifiedUrl" equals "dist/main.js"
And the sourcemap payload field "sourceMap" matches the expected source map for "single-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the expected minified file for "single-source-map-webpack"
And the Content-Type header is valid multipart form-data
Scenario: A request will not be retried if the bundle or source map is empty (422 status code)
When I set the HTTP status code for the next request to 422
And I run the service "single-source-map-webpack" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--app-version 2.0.0
--source-map dist/main.js.map
--bundle dist/main.js
--endpoint http://maze-runner:9339
"""
And I wait to receive 1 sourcemap
Then the last run docker command did not exit successfully
And the last run docker command output "The uploaded source map was empty."
And the last run docker command output "HTTP status 422 received from upload API"
And the sourcemap payload field "apiKey" equals "123"
And the sourcemap payload field "appVersion" equals "2.0.0"
And the sourcemap payload field "overwrite" is null
And the sourcemap payload field "minifiedUrl" equals "dist/main.js"
And the sourcemap payload field "sourceMap" matches the expected source map for "single-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the expected minified file for "single-source-map-webpack"
And the Content-Type header is valid multipart form-data
Scenario: A request will not be retried if request is bad (400 status code)
When I set the HTTP status code for the next request to 400
And I run the service "single-source-map-webpack" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--app-version 2.0.0
--source-map dist/main.js.map
--bundle dist/main.js
--endpoint http://maze-runner:9339
"""
And I wait to receive 1 sourcemap
Then the last run docker command did not exit successfully
And the last run docker command output "The request was rejected by the server as invalid."
And the last run docker command output "HTTP status 400 received from upload API"
And the sourcemap payload field "apiKey" equals "123"
And the sourcemap payload field "appVersion" equals "2.0.0"
And the sourcemap payload field "overwrite" is null
And the sourcemap payload field "minifiedUrl" equals "dist/main.js"
And the sourcemap payload field "sourceMap" matches the expected source map for "single-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the expected minified file for "single-source-map-webpack"
And the Content-Type header is valid multipart form-data
Scenario: A request can set a timeout using the --idle-timeout flag
When I set the response delay to 5000 milliseconds
And I run the service "single-source-map-webpack" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--app-version 2.0.0
--source-map dist/main.js.map
--bundle dist/main.js
--endpoint http://maze-runner:9339
--idle-timeout 0.0008 # approx 50ms in minutes
"""
Then the last run docker command did not exit successfully
And the last run docker command output "The request timed out."
When I wait to receive 5 sourcemaps
And the Content-Type header is valid multipart form-data for all requests
And the sourcemap payload field "apiKey" equals "123" for all requests
And the sourcemap payload field "appVersion" equals "2.0.0" for all requests
And the sourcemap payload field "overwrite" is null for all requests
And the sourcemap payload field "minifiedUrl" equals "dist/main.js" for all requests
And the sourcemap payload field "sourceMap" matches the expected source map for "single-source-map-webpack" for all requests
And the sourcemap payload field "minifiedFile" matches the expected minified file for "single-source-map-webpack" for all requests