-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathnode-upload-multiple.feature
354 lines (341 loc) · 22.1 KB
/
node-upload-multiple.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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
Feature: Node source map upload multiple
Scenario: Basic success case (webpack)
When I run the service "multiple-source-map-webpack" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--app-version 2.0.0
--directory dist
--endpoint http://maze-runner:9339
"""
And I wait to receive 3 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-b3944033.js"
And the sourcemap payload field "sourceMap" matches the source map "main-b3944033.json" for "multiple-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the minified file "main-b3944033.js" for "multiple-source-map-webpack"
When I discard the oldest sourcemap
And the sourcemap payload field "minifiedUrl" equals "dist/main-cb48d68d.js"
And the sourcemap payload field "sourceMap" matches the source map "main-cb48d68d.json" for "multiple-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the minified file "main-cb48d68d.js" for "multiple-source-map-webpack"
When I discard the oldest sourcemap
And the sourcemap payload field "minifiedUrl" equals "dist/main-d89fcf10.js"
And the sourcemap payload field "sourceMap" matches the source map "main-d89fcf10.json" for "multiple-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the minified file "main-d89fcf10.js" for "multiple-source-map-webpack"
Scenario: Basic success case (webpack) with absolute path --directory
When I run the service "multiple-source-map-webpack" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--app-version 2.0.0
--directory /app/dist
--endpoint http://maze-runner:9339
"""
And I wait to receive 3 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-b3944033.js"
And the sourcemap payload field "sourceMap" matches the source map "main-b3944033.json" for "multiple-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the minified file "main-b3944033.js" for "multiple-source-map-webpack"
When I discard the oldest sourcemap
And the sourcemap payload field "minifiedUrl" equals "dist/main-cb48d68d.js"
And the sourcemap payload field "sourceMap" matches the source map "main-cb48d68d.json" for "multiple-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the minified file "main-cb48d68d.js" for "multiple-source-map-webpack"
When I discard the oldest sourcemap
And the sourcemap payload field "minifiedUrl" equals "dist/main-d89fcf10.js"
And the sourcemap payload field "sourceMap" matches the source map "main-d89fcf10.json" for "multiple-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the minified file "main-d89fcf10.js" for "multiple-source-map-webpack"
Scenario: Basic success case (babel)
When I run the service "multiple-source-map-babel-node" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--app-version 2.0.0
--directory dist/
--endpoint http://maze-runner:9339
"""
And I wait to receive 3 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/index.js"
And the sourcemap payload field "sourceMap" matches the source map "index.json" for "multiple-source-map-babel-node"
And the sourcemap payload field "minifiedFile" matches the minified file "index.js" for "multiple-source-map-babel-node"
When I discard the oldest sourcemap
And the sourcemap payload field "minifiedUrl" equals "dist/lib/a.js"
And the sourcemap payload field "sourceMap" matches the source map "a.json" for "multiple-source-map-babel-node"
And the sourcemap payload field "minifiedFile" matches the minified file "a.js" for "multiple-source-map-babel-node"
When I discard the oldest sourcemap
And the sourcemap payload field "minifiedUrl" equals "dist/lib/b.js"
And the sourcemap payload field "sourceMap" matches the source map "b.json" for "multiple-source-map-babel-node"
And the sourcemap payload field "minifiedFile" matches the minified file "b.js" for "multiple-source-map-babel-node"
Scenario: Basic success case (typescript)
When I run the service "multiple-source-map-typescript" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--app-version 2.0.0
--directory dist
--endpoint http://maze-runner:9339
"""
And I wait to receive 3 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/index.js"
And the sourcemap payload field "sourceMap" matches the source map "index.json" for "multiple-source-map-typescript"
And the sourcemap payload field "minifiedFile" matches the minified file "index.js" for "multiple-source-map-typescript"
When I discard the oldest sourcemap
And the sourcemap payload field "minifiedUrl" equals "dist/lib/a.js"
And the sourcemap payload field "sourceMap" matches the source map "a.json" for "multiple-source-map-typescript"
And the sourcemap payload field "minifiedFile" matches the minified file "a.js" for "multiple-source-map-typescript"
When I discard the oldest sourcemap
And the sourcemap payload field "minifiedUrl" equals "dist/lib/b.js"
And the sourcemap payload field "sourceMap" matches the source map "b.json" for "multiple-source-map-typescript"
And the sourcemap payload field "minifiedFile" matches the minified file "b.js" for "multiple-source-map-typescript"
Scenario: Detected app version
When I run the service "multiple-source-map-webpack" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--detect-app-version
--directory dist
--endpoint http://maze-runner:9339
"""
And I wait to receive 3 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 "4.5.6" for all requests
And the sourcemap payload field "overwrite" is null for all requests
And the sourcemap payload field "minifiedUrl" equals "dist/main-b3944033.js"
And the sourcemap payload field "sourceMap" matches the source map "main-b3944033.json" for "multiple-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the minified file "main-b3944033.js" for "multiple-source-map-webpack"
When I discard the oldest sourcemap
And the sourcemap payload field "minifiedUrl" equals "dist/main-cb48d68d.js"
And the sourcemap payload field "sourceMap" matches the source map "main-cb48d68d.json" for "multiple-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the minified file "main-cb48d68d.js" for "multiple-source-map-webpack"
When I discard the oldest sourcemap
And the sourcemap payload field "minifiedUrl" equals "dist/main-d89fcf10.js"
And the sourcemap payload field "sourceMap" matches the source map "main-d89fcf10.json" for "multiple-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the minified file "main-d89fcf10.js" for "multiple-source-map-webpack"
Scenario: codeBundleId support
When I run the service "multiple-source-map-webpack" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--code-bundle-id r0124
--directory dist
--endpoint http://maze-runner:9339
"""
And I wait to receive 3 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 "codeBundleId" equals "r0124" for all requests
And the sourcemap payload field "overwrite" is null for all requests
And the sourcemap payload field "minifiedUrl" equals "dist/main-b3944033.js"
And the sourcemap payload field "sourceMap" matches the source map "main-b3944033.json" for "multiple-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the minified file "main-b3944033.js" for "multiple-source-map-webpack"
When I discard the oldest sourcemap
And the sourcemap payload field "minifiedUrl" equals "dist/main-cb48d68d.js"
And the sourcemap payload field "sourceMap" matches the source map "main-cb48d68d.json" for "multiple-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the minified file "main-cb48d68d.js" for "multiple-source-map-webpack"
When I discard the oldest sourcemap
And the sourcemap payload field "minifiedUrl" equals "dist/main-d89fcf10.js"
And the sourcemap payload field "sourceMap" matches the source map "main-d89fcf10.json" for "multiple-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the minified file "main-d89fcf10.js" for "multiple-source-map-webpack"
Scenario: Overwrite enabled
When I run the service "multiple-source-map-webpack" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--app-version 2.0.0
--directory dist
--endpoint http://maze-runner:9339
--overwrite
"""
And I wait to receive 3 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" equals "true" for all requests
And the sourcemap payload field "minifiedUrl" equals "dist/main-b3944033.js"
And the sourcemap payload field "sourceMap" matches the source map "main-b3944033.json" for "multiple-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the minified file "main-b3944033.js" for "multiple-source-map-webpack"
When I discard the oldest sourcemap
And the sourcemap payload field "minifiedUrl" equals "dist/main-cb48d68d.js"
And the sourcemap payload field "sourceMap" matches the source map "main-cb48d68d.json" for "multiple-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the minified file "main-cb48d68d.js" for "multiple-source-map-webpack"
When I discard the oldest sourcemap
And the sourcemap payload field "minifiedUrl" equals "dist/main-d89fcf10.js"
And the sourcemap payload field "sourceMap" matches the source map "main-d89fcf10.json" for "multiple-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the minified file "main-d89fcf10.js" for "multiple-source-map-webpack"
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 "multiple-source-map-webpack" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--app-version 2.0.0
--directory dist
--endpoint http://maze-runner:9339
"""
And I wait to receive 4 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-b3944033.js"
And the sourcemap payload field "sourceMap" matches the source map "main-b3944033.json" for "multiple-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the minified file "main-b3944033.js" for "multiple-source-map-webpack"
When I discard the oldest sourcemap
And the sourcemap payload field "minifiedUrl" equals "dist/main-b3944033.js"
And the sourcemap payload field "sourceMap" matches the source map "main-b3944033.json" for "multiple-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the minified file "main-b3944033.js" for "multiple-source-map-webpack"
When I discard the oldest sourcemap
And the sourcemap payload field "minifiedUrl" equals "dist/main-cb48d68d.js"
And the sourcemap payload field "sourceMap" matches the source map "main-cb48d68d.json" for "multiple-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the minified file "main-cb48d68d.js" for "multiple-source-map-webpack"
When I discard the oldest sourcemap
And the sourcemap payload field "minifiedUrl" equals "dist/main-d89fcf10.js"
And the sourcemap payload field "sourceMap" matches the source map "main-d89fcf10.json" for "multiple-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the minified file "main-d89fcf10.js" for "multiple-source-map-webpack"
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 "multiple-source-map-webpack" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--app-version 2.0.0
--directory dist
--endpoint http://maze-runner:9339
"""
And I wait to receive 5 sourcemaps
Then the last run docker command did not exit successfully
And the Content-Type header is valid multipart form-data for all requests
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 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-b3944033.js" for all requests
And the sourcemap payload field "sourceMap" matches the source map "main-b3944033.json" for "multiple-source-map-webpack" for all requests
And the sourcemap payload field "minifiedFile" matches the minified file "main-b3944033.js" for "multiple-source-map-webpack" for all requests
Scenario: A request will not be retried and further requests will not be made 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 "multiple-source-map-webpack" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--app-version 2.0.0
--directory dist
--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-b3944033.js"
And the sourcemap payload field "sourceMap" matches the source map "main-b3944033.json" for "multiple-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the minified file "main-b3944033.js" for "multiple-source-map-webpack"
And the Content-Type header is valid multipart form-data
Scenario: A request will not be retried and further requests will not be made 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 "multiple-source-map-webpack" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--app-version 2.0.0
--directory dist
--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-b3944033.js"
And the sourcemap payload field "sourceMap" matches the source map "main-b3944033.json" for "multiple-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the minified file "main-b3944033.js" for "multiple-source-map-webpack"
And the Content-Type header is valid multipart form-data
Scenario: A request will not be retried and further requests will not be made 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 "multiple-source-map-webpack" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--app-version 2.0.0
--directory dist
--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-b3944033.js"
And the sourcemap payload field "sourceMap" matches the source map "main-b3944033.json" for "multiple-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the minified file "main-b3944033.js" for "multiple-source-map-webpack"
And the Content-Type header is valid multipart form-data
Scenario: A request will not be retried and further requests will not be made 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 "multiple-source-map-webpack" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--app-version 2.0.0
--directory dist
--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-b3944033.js"
And the sourcemap payload field "sourceMap" matches the source map "main-b3944033.json" for "multiple-source-map-webpack"
And the sourcemap payload field "minifiedFile" matches the minified file "main-b3944033.js" for "multiple-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 "multiple-source-map-webpack" with the command
"""
bugsnag-source-maps upload-node
--api-key 123
--app-version 2.0.0
--directory dist
--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-b3944033.js" for all requests
And the sourcemap payload field "sourceMap" matches the source map "main-b3944033.json" for "multiple-source-map-webpack" for all requests
And the sourcemap payload field "minifiedFile" matches the minified file "main-b3944033.js" for "multiple-source-map-webpack" for all requests