Merge pull request #105 from bugsnag/fix-go-112-test-failures
Officially support Go 1.12
Ben Gourley authored 5 years ago
GitHub committed 5 years ago
21 | 21 | go: "1.10" |
22 | 22 | - script: make ci |
23 | 23 | go: "1.11" |
24 | - script: make ci | |
25 | go: "1.12" | |
24 | 26 | |
25 | 27 | - stage: plain go app tests |
26 | 28 | script: make testplain |
29 | env: GO_VERSION=1.12 | |
30 | - if: branch = master | |
31 | script: make testplain | |
27 | 32 | env: GO_VERSION=1.11 |
28 | 33 | - if: branch = master |
29 | 34 | script: make testplain |
41 | 46 | |
42 | 47 | - stage: net/http tests |
43 | 48 | script: make testnethttp |
49 | env: GO_VERSION=1.12 | |
50 | - if: branch = master | |
51 | script: make testnethttp | |
44 | 52 | env: GO_VERSION=1.11 |
45 | 53 | - if: branch = master |
46 | 54 | script: make testnethttp |
59 | 67 | - stage: gin tests |
60 | 68 | script: make testgin |
61 | 69 | env: |
62 | - GO_VERSION=1.11 | |
63 | - GIN_VERSION=v1.3.0 | |
64 | - if: branch = master | |
65 | script: make testgin | |
66 | env: | |
67 | - GO_VERSION=1.10 | |
68 | - GIN_VERSION=v1.3.0 | |
69 | - if: branch = master | |
70 | script: make testgin | |
71 | env: | |
72 | - GO_VERSION=1.9 | |
73 | - GIN_VERSION=v1.3.0 | |
74 | - if: branch = master | |
75 | script: make testgin | |
76 | env: | |
77 | - GO_VERSION=1.8 | |
78 | - GIN_VERSION=v1.3.0 | |
79 | - if: branch = master | |
80 | script: make testgin | |
81 | env: | |
82 | - GO_VERSION=1.7 | |
83 | - GIN_VERSION=v1.3.0 | |
84 | ||
85 | - if: branch = master | |
86 | script: make testgin | |
87 | env: | |
88 | - GO_VERSION=1.11 | |
89 | - GIN_VERSION=v1.2 | |
90 | - if: branch = master | |
91 | script: make testgin | |
92 | env: | |
93 | - GO_VERSION=1.10 | |
94 | - GIN_VERSION=v1.2 | |
95 | - if: branch = master | |
96 | script: make testgin | |
97 | env: | |
98 | - GO_VERSION=1.9 | |
99 | - GIN_VERSION=v1.2 | |
100 | - if: branch = master | |
101 | script: make testgin | |
102 | env: | |
103 | - GO_VERSION=1.8 | |
104 | - GIN_VERSION=v1.2 | |
105 | - if: branch = master | |
106 | script: make testgin | |
107 | env: | |
108 | - GO_VERSION=1.7 | |
109 | - GIN_VERSION=v1.2 | |
110 | ||
111 | - if: branch = master | |
112 | script: make testgin | |
113 | env: | |
114 | - GO_VERSION=1.11 | |
115 | - GIN_VERSION=v1.1 | |
116 | - if: branch = master | |
117 | script: make testgin | |
118 | env: | |
119 | - GO_VERSION=1.10 | |
120 | - GIN_VERSION=v1.1 | |
121 | - if: branch = master | |
122 | script: make testgin | |
123 | env: | |
124 | - GO_VERSION=1.9 | |
125 | - GIN_VERSION=v1.1 | |
126 | - if: branch = master | |
127 | script: make testgin | |
128 | env: | |
129 | - GO_VERSION=1.8 | |
130 | - GIN_VERSION=v1.1 | |
131 | - if: branch = master | |
132 | script: make testgin | |
133 | env: | |
134 | - GO_VERSION=1.7 | |
135 | - GIN_VERSION=v1.1 | |
136 | ||
70 | - GO_VERSION=1.12 | |
71 | - GIN_VERSION=v1.3.0 | |
72 | - if: branch = master | |
73 | script: make testgin | |
74 | env: | |
75 | - GO_VERSION=1.11 | |
76 | - GIN_VERSION=v1.3.0 | |
77 | - if: branch = master | |
78 | script: make testgin | |
79 | env: | |
80 | - GO_VERSION=1.10 | |
81 | - GIN_VERSION=v1.3.0 | |
82 | - if: branch = master | |
83 | script: make testgin | |
84 | env: | |
85 | - GO_VERSION=1.9 | |
86 | - GIN_VERSION=v1.3.0 | |
87 | - if: branch = master | |
88 | script: make testgin | |
89 | env: | |
90 | - GO_VERSION=1.8 | |
91 | - GIN_VERSION=v1.3.0 | |
92 | - if: branch = master | |
93 | script: make testgin | |
94 | env: | |
95 | - GO_VERSION=1.7 | |
96 | - GIN_VERSION=v1.3.0 | |
97 | ||
98 | - if: branch = master | |
99 | script: make testgin | |
100 | env: | |
101 | - GO_VERSION=1.12 | |
102 | - GIN_VERSION=v1.2 | |
103 | - if: branch = master | |
104 | script: make testgin | |
105 | env: | |
106 | - GO_VERSION=1.11 | |
107 | - GIN_VERSION=v1.2 | |
108 | - if: branch = master | |
109 | script: make testgin | |
110 | env: | |
111 | - GO_VERSION=1.10 | |
112 | - GIN_VERSION=v1.2 | |
113 | - if: branch = master | |
114 | script: make testgin | |
115 | env: | |
116 | - GO_VERSION=1.9 | |
117 | - GIN_VERSION=v1.2 | |
118 | - if: branch = master | |
119 | script: make testgin | |
120 | env: | |
121 | - GO_VERSION=1.8 | |
122 | - GIN_VERSION=v1.2 | |
123 | - if: branch = master | |
124 | script: make testgin | |
125 | env: | |
126 | - GO_VERSION=1.7 | |
127 | - GIN_VERSION=v1.2 | |
128 | ||
129 | - if: branch = master | |
130 | script: make testgin | |
131 | env: | |
132 | - GO_VERSION=1.12 | |
133 | - GIN_VERSION=v1.1 | |
134 | - if: branch = master | |
135 | script: make testgin | |
136 | env: | |
137 | - GO_VERSION=1.11 | |
138 | - GIN_VERSION=v1.1 | |
139 | - if: branch = master | |
140 | script: make testgin | |
141 | env: | |
142 | - GO_VERSION=1.10 | |
143 | - GIN_VERSION=v1.1 | |
144 | - if: branch = master | |
145 | script: make testgin | |
146 | env: | |
147 | - GO_VERSION=1.9 | |
148 | - GIN_VERSION=v1.1 | |
149 | - if: branch = master | |
150 | script: make testgin | |
151 | env: | |
152 | - GO_VERSION=1.8 | |
153 | - GIN_VERSION=v1.1 | |
154 | - if: branch = master | |
155 | script: make testgin | |
156 | env: | |
157 | - GO_VERSION=1.7 | |
158 | - GIN_VERSION=v1.1 | |
159 | ||
160 | - if: branch = master | |
161 | script: make testgin | |
162 | env: | |
163 | - GO_VERSION=1.12 | |
164 | - GIN_VERSION=v1.0 | |
137 | 165 | - if: branch = master |
138 | 166 | script: make testgin |
139 | 167 | env: |
162 | 190 | |
163 | 191 | - stage: martini tests |
164 | 192 | script: make testmartini |
193 | env: GO_VERSION=1.12 | |
194 | - if: branch = master | |
195 | script: make testmartini | |
165 | 196 | env: GO_VERSION=1.11 |
166 | 197 | - if: branch = master |
167 | 198 | script: make testmartini |
179 | 210 | - stage: negroni tests |
180 | 211 | script: make testnegroni |
181 | 212 | env: |
182 | - GO_VERSION=1.11 | |
183 | - NEGRONI_VERSION=v1.0.0 | |
184 | - if: branch = master | |
185 | script: make testnegroni | |
186 | env: | |
187 | - GO_VERSION=1.10 | |
188 | - NEGRONI_VERSION=v1.0.0 | |
189 | - if: branch = master | |
190 | script: make testnegroni | |
191 | env: | |
192 | - GO_VERSION=1.9 | |
193 | - NEGRONI_VERSION=v1.0.0 | |
194 | - if: branch = master | |
195 | script: make testnegroni | |
196 | env: | |
197 | - GO_VERSION=1.8 | |
198 | - NEGRONI_VERSION=v1.0.0 | |
199 | - if: branch = master | |
200 | script: make testnegroni | |
201 | env: | |
202 | - GO_VERSION=1.7 | |
203 | - NEGRONI_VERSION=v1.0.0 | |
204 | ||
205 | - if: branch = master | |
206 | script: make testnegroni | |
207 | env: | |
208 | - GO_VERSION=1.11 | |
209 | - NEGRONI_VERSION=v0.3.0 | |
210 | - if: branch = master | |
211 | script: make testnegroni | |
212 | env: | |
213 | - GO_VERSION=1.10 | |
214 | - NEGRONI_VERSION=v0.3.0 | |
215 | - if: branch = master | |
216 | script: make testnegroni | |
217 | env: | |
218 | - GO_VERSION=1.9 | |
219 | - NEGRONI_VERSION=v0.3.0 | |
220 | - if: branch = master | |
221 | script: make testnegroni | |
222 | env: | |
223 | - GO_VERSION=1.8 | |
224 | - NEGRONI_VERSION=v0.3.0 | |
225 | - if: branch = master | |
226 | script: make testnegroni | |
227 | env: | |
228 | - GO_VERSION=1.7 | |
229 | - NEGRONI_VERSION=v0.3.0 | |
230 | ||
231 | - if: branch = master | |
232 | script: make testnegroni | |
233 | env: | |
234 | - GO_VERSION=1.11 | |
235 | - NEGRONI_VERSION=v0.2.0 | |
236 | - if: branch = master | |
237 | script: make testnegroni | |
238 | env: | |
239 | - GO_VERSION=1.10 | |
240 | - NEGRONI_VERSION=v0.2.0 | |
241 | - if: branch = master | |
242 | script: make testnegroni | |
243 | env: | |
244 | - GO_VERSION=1.9 | |
245 | - NEGRONI_VERSION=v0.2.0 | |
246 | - if: branch = master | |
247 | script: make testnegroni | |
248 | env: | |
249 | - GO_VERSION=1.8 | |
250 | - NEGRONI_VERSION=v0.2.0 | |
251 | - if: branch = master | |
252 | script: make testnegroni | |
253 | env: | |
254 | - GO_VERSION=1.7 | |
255 | - NEGRONI_VERSION=v0.2.0 | |
256 | ||
213 | - GO_VERSION=1.12 | |
214 | - NEGRONI_VERSION=v1.0.0 | |
215 | - if: branch = master | |
216 | script: make testnegroni | |
217 | env: | |
218 | - GO_VERSION=1.11 | |
219 | - NEGRONI_VERSION=v1.0.0 | |
220 | - if: branch = master | |
221 | script: make testnegroni | |
222 | env: | |
223 | - GO_VERSION=1.10 | |
224 | - NEGRONI_VERSION=v1.0.0 | |
225 | - if: branch = master | |
226 | script: make testnegroni | |
227 | env: | |
228 | - GO_VERSION=1.9 | |
229 | - NEGRONI_VERSION=v1.0.0 | |
230 | - if: branch = master | |
231 | script: make testnegroni | |
232 | env: | |
233 | - GO_VERSION=1.8 | |
234 | - NEGRONI_VERSION=v1.0.0 | |
235 | - if: branch = master | |
236 | script: make testnegroni | |
237 | env: | |
238 | - GO_VERSION=1.7 | |
239 | - NEGRONI_VERSION=v1.0.0 | |
240 | ||
241 | - if: branch = master | |
242 | script: make testnegroni | |
243 | env: | |
244 | - GO_VERSION=1.12 | |
245 | - NEGRONI_VERSION=v0.3.0 | |
246 | - if: branch = master | |
247 | script: make testnegroni | |
248 | env: | |
249 | - GO_VERSION=1.11 | |
250 | - NEGRONI_VERSION=v0.3.0 | |
251 | - if: branch = master | |
252 | script: make testnegroni | |
253 | env: | |
254 | - GO_VERSION=1.10 | |
255 | - NEGRONI_VERSION=v0.3.0 | |
256 | - if: branch = master | |
257 | script: make testnegroni | |
258 | env: | |
259 | - GO_VERSION=1.9 | |
260 | - NEGRONI_VERSION=v0.3.0 | |
261 | - if: branch = master | |
262 | script: make testnegroni | |
263 | env: | |
264 | - GO_VERSION=1.8 | |
265 | - NEGRONI_VERSION=v0.3.0 | |
266 | - if: branch = master | |
267 | script: make testnegroni | |
268 | env: | |
269 | - GO_VERSION=1.7 | |
270 | - NEGRONI_VERSION=v0.3.0 | |
271 | ||
272 | - if: branch = master | |
273 | script: make testnegroni | |
274 | env: | |
275 | - GO_VERSION=1.12 | |
276 | - NEGRONI_VERSION=v0.2.0 | |
277 | - if: branch = master | |
278 | script: make testnegroni | |
279 | env: | |
280 | - GO_VERSION=1.11 | |
281 | - NEGRONI_VERSION=v0.2.0 | |
282 | - if: branch = master | |
283 | script: make testnegroni | |
284 | env: | |
285 | - GO_VERSION=1.10 | |
286 | - NEGRONI_VERSION=v0.2.0 | |
287 | - if: branch = master | |
288 | script: make testnegroni | |
289 | env: | |
290 | - GO_VERSION=1.9 | |
291 | - NEGRONI_VERSION=v0.2.0 | |
292 | - if: branch = master | |
293 | script: make testnegroni | |
294 | env: | |
295 | - GO_VERSION=1.8 | |
296 | - NEGRONI_VERSION=v0.2.0 | |
297 | - if: branch = master | |
298 | script: make testnegroni | |
299 | env: | |
300 | - GO_VERSION=1.7 | |
301 | - NEGRONI_VERSION=v0.2.0 | |
257 | 302 | |
258 | 303 | |
259 | 304 | - stage: revel tests |
260 | 305 | script: make testrevel |
261 | 306 | env: |
262 | - GO_VERSION=1.11 | |
307 | - GO_VERSION=1.12 | |
263 | 308 | - REVEL_VERSION=v0.21.0 |
264 | 309 | - REVEL_CMD_VERSION=v0.21.1 |
265 | 310 | - if: branch = master |
266 | 311 | script: make testrevel |
267 | 312 | env: |
268 | - GO_VERSION=1.10 | |
313 | - GO_VERSION=1.11 | |
269 | 314 | - REVEL_VERSION=v0.21.0 |
270 | 315 | - REVEL_CMD_VERSION=v0.21.1 |
271 | 316 | - if: branch = master |
272 | 317 | script: make testrevel |
273 | 318 | env: |
274 | - GO_VERSION=1.9 | |
319 | - GO_VERSION=1.10 | |
275 | 320 | - REVEL_VERSION=v0.21.0 |
276 | 321 | - REVEL_CMD_VERSION=v0.21.1 |
277 | 322 | - if: branch = master |
278 | 323 | script: make testrevel |
279 | 324 | env: |
280 | - GO_VERSION=1.8 | |
325 | - GO_VERSION=1.9 | |
281 | 326 | - REVEL_VERSION=v0.21.0 |
282 | 327 | - REVEL_CMD_VERSION=v0.21.1 |
283 | ||
284 | - if: branch = master | |
285 | script: make testrevel | |
286 | env: | |
287 | - GO_VERSION=1.11 | |
328 | - if: branch = master | |
329 | script: make testrevel | |
330 | env: | |
331 | - GO_VERSION=1.8 | |
332 | - REVEL_VERSION=v0.21.0 | |
333 | - REVEL_CMD_VERSION=v0.21.1 | |
334 | ||
335 | - if: branch = master | |
336 | script: make testrevel | |
337 | env: | |
338 | - GO_VERSION=1.12 | |
288 | 339 | - REVEL_VERSION=v0.20.0 |
289 | 340 | - REVEL_CMD_VERSION=v0.20.2 |
290 | 341 | - if: branch = master |
291 | 342 | script: make testrevel |
292 | 343 | env: |
293 | - GO_VERSION=1.10 | |
344 | - GO_VERSION=1.11 | |
294 | 345 | - REVEL_VERSION=v0.20.0 |
295 | 346 | - REVEL_CMD_VERSION=v0.20.2 |
296 | 347 | - if: branch = master |
297 | 348 | script: make testrevel |
298 | 349 | env: |
299 | - GO_VERSION=1.9 | |
350 | - GO_VERSION=1.10 | |
300 | 351 | - REVEL_VERSION=v0.20.0 |
301 | 352 | - REVEL_CMD_VERSION=v0.20.2 |
302 | 353 | - if: branch = master |
303 | 354 | script: make testrevel |
304 | 355 | env: |
305 | - GO_VERSION=1.8 | |
356 | - GO_VERSION=1.9 | |
306 | 357 | - REVEL_VERSION=v0.20.0 |
307 | 358 | - REVEL_CMD_VERSION=v0.20.2 |
308 | ||
309 | ||
310 | - if: branch = master | |
311 | script: make testrevel | |
312 | env: | |
313 | - GO_VERSION=1.11 | |
359 | - if: branch = master | |
360 | script: make testrevel | |
361 | env: | |
362 | - GO_VERSION=1.8 | |
363 | - REVEL_VERSION=v0.20.0 | |
364 | - REVEL_CMD_VERSION=v0.20.2 | |
365 | ||
366 | - if: branch = master | |
367 | script: make testrevel | |
368 | env: | |
369 | - GO_VERSION=1.12 | |
314 | 370 | - REVEL_VERSION=v0.19.1 |
315 | 371 | - REVEL_CMD_VERSION=v0.19.0 |
316 | 372 | - if: branch = master |
317 | 373 | script: make testrevel |
318 | 374 | env: |
319 | - GO_VERSION=1.10 | |
375 | - GO_VERSION=1.11 | |
320 | 376 | - REVEL_VERSION=v0.19.1 |
321 | 377 | - REVEL_CMD_VERSION=v0.19.0 |
322 | 378 | - if: branch = master |
323 | 379 | script: make testrevel |
324 | 380 | env: |
325 | - GO_VERSION=1.9 | |
381 | - GO_VERSION=1.10 | |
326 | 382 | - REVEL_VERSION=v0.19.1 |
327 | 383 | - REVEL_CMD_VERSION=v0.19.0 |
328 | ||
329 | - if: branch = master | |
330 | script: make testrevel | |
331 | env: | |
332 | - GO_VERSION=1.11 | |
384 | - if: branch = master | |
385 | script: make testrevel | |
386 | env: | |
387 | - GO_VERSION=1.9 | |
388 | - REVEL_VERSION=v0.19.1 | |
389 | - REVEL_CMD_VERSION=v0.19.0 | |
390 | ||
391 | - if: branch = master | |
392 | script: make testrevel | |
393 | env: | |
394 | - GO_VERSION=1.12 | |
333 | 395 | - REVEL_VERSION=v0.18.0 |
334 | 396 | - REVEL_CMD_VERSION=v0.18.0 |
335 | 397 | - if: branch = master |
336 | 398 | script: make testrevel |
337 | 399 | env: |
338 | - GO_VERSION=1.10 | |
400 | - GO_VERSION=1.11 | |
339 | 401 | - REVEL_VERSION=v0.18.0 |
340 | 402 | - REVEL_CMD_VERSION=v0.18.0 |
341 | 403 | - if: branch = master |
342 | 404 | script: make testrevel |
343 | 405 | env: |
344 | - GO_VERSION=1.9 | |
406 | - GO_VERSION=1.10 | |
345 | 407 | - REVEL_VERSION=v0.18.0 |
346 | 408 | - REVEL_CMD_VERSION=v0.18.0 |
409 | - if: branch = master | |
410 | script: make testrevel | |
411 | env: | |
412 | - GO_VERSION=1.9 | |
413 | - REVEL_VERSION=v0.18.0 | |
414 | - REVEL_CMD_VERSION=v0.18.0 |
91 | 91 | return nil |
92 | 92 | }) |
93 | 93 | |
94 | Notify( | |
95 | fmt.Errorf("hello world"), | |
96 | StartSession(context.Background()), | |
97 | generateSampleConfig(ts.URL), | |
98 | User{Id: "123", Name: "Conrad", Email: "me@cirw.in"}, | |
99 | Context{"testing"}, | |
100 | MetaData{"test": { | |
101 | "password": "sneaky", | |
102 | "value": "able", | |
103 | "broken": complex(1, 2), | |
104 | "recurse": recurse, | |
105 | }}, | |
106 | ) | |
94 | md := MetaData{"test": {"password": "sneaky", "value": "able", "broken": complex(1, 2), "recurse": recurse}} | |
95 | user := User{Id: "123", Name: "Conrad", Email: "me@cirw.in"} | |
96 | config := generateSampleConfig(ts.URL) | |
97 | Notify(fmt.Errorf("hello world"), StartSession(context.Background()), config, user, Context{"testing"}, md) | |
107 | 98 | |
108 | 99 | json, err := simplejson.NewJson(<-reports) |
109 | 100 | |
140 | 131 | } |
141 | 132 | |
142 | 133 | exception := getIndex(event, "exceptions", 0) |
143 | checkFrame(t, getIndex(exception, "stacktrace", 0), stackFrame{File: "bugsnag_test.go", Method: "TestNotify", InProject: true}) | |
144 | checkFrame(t, getIndex(exception, "stacktrace", 1), stackFrame{File: "testing/testing.go", Method: "tRunner", InProject: false}) | |
134 | verifyExistsInStackTrace(t, exception, &stackFrame{File: "bugsnag_test.go", Method: "TestNotify", LineNumber: 98, InProject: true}) | |
145 | 135 | } |
146 | 136 | |
147 | 137 | type testPublisher struct { |
324 | 314 | } |
325 | 315 | |
326 | 316 | exception := getIndex(event, "exceptions", 0) |
327 | checkFrame(t, getIndex(exception, "stacktrace", 0), stackFrame{File: "runtime/panic.go", Method: "gopanic", InProject: false}) | |
328 | checkFrame(t, getIndex(exception, "stacktrace", 3), stackFrame{File: "bugsnag_test.go", Method: "crashyHandler", InProject: true}) | |
317 | verifyExistsInStackTrace(t, exception, &stackFrame{File: "bugsnag_test.go", Method: "crashyHandler", InProject: true, LineNumber: 24}) | |
329 | 318 | } |
330 | 319 | |
331 | 320 | func TestAutoNotify(t *testing.T) { |
621 | 610 | } |
622 | 611 | } |
623 | 612 | |
624 | func checkFrame(t *testing.T, frame *simplejson.Json, exp stackFrame) { | |
625 | if got := getString(frame, "file"); got != exp.File { | |
626 | t.Errorf("Expected frame file to be '%s' but was '%s'", exp.File, got) | |
627 | } | |
628 | if got := getString(frame, "method"); got != exp.Method { | |
629 | t.Errorf("Expected frame method to be '%s' but was '%s'", exp.Method, got) | |
630 | } | |
631 | // We can unfortunately not be more specific with this check as different | |
632 | // versions of Go might add/remove stack frames | |
633 | if got := getInt(frame, "lineNumber"); got == 0 { | |
634 | t.Errorf("Expected frame line number to be %d but was %d", exp.LineNumber, got) | |
635 | } | |
636 | if got := getBool(frame, "inProject"); got != exp.InProject { | |
637 | t.Errorf("Expected frame inProject to be '%v' but was '%v'", exp.InProject, got) | |
638 | } | |
639 | } | |
613 | func verifyExistsInStackTrace(t *testing.T, exception *simplejson.Json, exp *stackFrame) { | |
614 | isFile := func(frame *simplejson.Json) bool { return getString(frame, "file") == exp.File } | |
615 | isMethod := func(frame *simplejson.Json) bool { return getString(frame, "method") == exp.Method } | |
616 | isLineNumber := func(frame *simplejson.Json) bool { return getInt(frame, "lineNumber") == exp.LineNumber } | |
617 | isInProject := func(frame *simplejson.Json) bool { return getBool(frame, "inProject") == exp.InProject } | |
618 | ||
619 | arr, _ := exception.Get("stacktrace").Array() | |
620 | for i := 0; i < len(arr); i++ { | |
621 | frame := getIndex(exception, "stacktrace", i) | |
622 | if isFile(frame) && isMethod(frame) && isLineNumber(frame) && isInProject(frame) { | |
623 | return | |
624 | } | |
625 | } | |
626 | t.Errorf("Could not find expected stackframe %v in exception '%v'", exp, exception) | |
627 | } |