Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: pylibs/buildbot/test/test_status_push.py

Issue 809001: Rename a few variables and greatly reduce the amount of data sent for steps* events (Closed)
Patch Set: Rebase against trunk and fix the unit test again Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pylibs/buildbot/status/status_push.py ('k') | pylibs/buildbot/test/test_web_status_json.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # -*- test-case-name: buildbot.test.test_status_push -*- 1 # -*- test-case-name: buildbot.test.test_status_push -*-
2 2
3 import re 3 import re
4 import os 4 import os
5 5
6 try: 6 try:
7 import simplejson as json 7 import simplejson as json
8 except ImportError: 8 except ImportError:
9 import json 9 import json
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 c['status'] = [HttpStatusPush('http://127.0.0.1:<PORT>/receiver')] 58 c['status'] = [HttpStatusPush('http://127.0.0.1:<PORT>/receiver')]
59 """) 59 """)
60 60
61 61
62 EXPECTED = [ 62 EXPECTED = [
63 { 63 {
64 'event': 'builderAdded', 64 'event': 'builderAdded',
65 'payload': { 65 'payload': {
66 'builder': { 66 'builder': {
67 "category": None, 67 "category": None,
68 "cached_builds": [], 68 "cachedBuilds": [],
69 "basedir": "quickdir", 69 "basedir": "quickdir",
70 "pending_builds": [], 70 "pendingBuilds": [],
71 "state": "offline", 71 "state": "offline",
72 "slaves": ["bot1"], 72 "slaves": ["bot1"],
73 "current_builds": [] 73 "currentBuilds": []
74 }, 74 },
75 'builderName': 'dummy', 75 'builderName': 'dummy',
76 } 76 }
77 }, 77 },
78 { 78 {
79 "event": "builderChangedState", 79 "event": "builderChangedState",
80 "payload": { 80 "payload": {
81 'state': 'offline', 81 'state': 'offline',
82 'builderName': 'dummy' 82 'builderName': 'dummy'
83 } 83 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 'payload': { 148 'payload': {
149 'state': 'building', 149 'state': 'building',
150 'builderName': 'dummy' 150 'builderName': 'dummy'
151 } 151 }
152 }, 152 },
153 { 153 {
154 'event': 'buildStarted', 154 'event': 'buildStarted',
155 'payload': { 155 'payload': {
156 'build': { 156 'build': {
157 'blame': [], 157 'blame': [],
158 'builderName': 'dummy',
158 'changes': [], 159 'changes': [],
159 'current_step': None, 160 'currentStep': None,
160 'eta': None, 161 'eta': None,
161 'number': 0, 162 'number': 0,
162 'properties': [ 163 'properties': [
163 ['branch', None, 'Build'], 164 ['branch', None, 'Build'],
164 ['buildername', 'dummy', 'Build'], 165 ['buildername', 'dummy', 'Build'],
165 ['buildnumber', 0, 'Build'], 166 ['buildnumber', 0, 'Build'],
166 ['revision', None, 'Build'], 167 ['revision', None, 'Build'],
167 ['slavename', 'bot1', 'BuildSlave'] 168 ['slavename', 'bot1', 'BuildSlave']
168 ], 169 ],
169 'reason': 'forced build', 170 'reason': 'forced build',
170 'requests': [ 171 'requests': [
171 { 172 {
172 'builderName': 'test_builder', 173 'builderName': 'test_builder',
173 'builds': [], 174 'builds': [],
174 'source': { 175 'source': {
175 'branch': None, 176 'branch': None,
176 'changes': [], 177 'changes': [],
177 'patch': None, 178 'patch': None,
178 'revision': None 179 'revision': None
179 }, 180 },
180 'submittedAt': 'yesterday' 181 'submittedAt': 'yesterday'
181 } 182 }
182 ], 183 ],
183 'results': None, 184 'results': None,
184 'slave': 'bot1', 185 'slave': 'bot1',
185 'source_stamp': { 186 'sourceStamp': {
186 'branch': None, 187 'branch': None,
187 'changes': [], 188 'changes': [],
188 'patch': None, 189 'patch': None,
189 'revision': None 190 'revision': None
190 }, 191 },
191 'steps': [ 192 'steps': [
192 { 193 {
193 'eta': None, 194 'eta': None,
194 'expectations': [], 195 'expectations': [],
195 'is_finished': False, 196 'isFinished': False,
196 'is_started': False, 197 'isStarted': False,
197 'name': 'cvs', 198 'name': 'cvs',
198 'results': [[None, []], []], 199 'results': [[None, []], []],
199 'statistics': {}, 200 'statistics': {},
200 'text': ['updating'], 201 'text': ['updating'],
201 'times': [None, None], 202 'times': [None, None],
202 'urls': {} 203 'urls': {}
203 }, 204 },
204 { 205 {
205 'eta': None, 206 'eta': None,
206 'expectations': [], 207 'expectations': [],
207 'is_finished': False, 208 'isFinished': False,
208 'is_started': False, 209 'isStarted': False,
209 'name': 'compile', 210 'name': 'compile',
210 'results': [[None, []], []], 211 'results': [[None, []], []],
211 'statistics': {}, 212 'statistics': {},
212 'text': ['compiling'], 213 'text': ['compiling'],
213 'times': [None, None], 214 'times': [None, None],
214 'urls': {} 215 'urls': {}
215 }, 216 },
216 { 217 {
217 'eta': None, 218 'eta': None,
218 'expectations': [], 219 'expectations': [],
219 'is_finished': False, 220 'isFinished': False,
220 'is_started': False, 221 'isStarted': False,
221 'name': 'test', 222 'name': 'test',
222 'results': [[None, []], []], 223 'results': [[None, []], []],
223 'statistics': {}, 224 'statistics': {},
224 'text': ['testing'], 225 'text': ['testing'],
225 'times': [None, None], 226 'times': [None, None],
226 'urls': {} 227 'urls': {}
227 } 228 }
228 ], 229 ],
229 'text': [], 230 'text': [],
230 'times': [123, None] 231 'times': [123, None]
231 } 232 }
232 } 233 }
233 }, 234 },
234 { 235 {
235 'event': 'stepStarted', 236 'event': 'stepStarted',
236 'payload': { 237 'payload': {
237 'step': { 238 'step': {
238 'eta': None, 239 'eta': None,
239 'expectations': [], 240 'expectations': [],
240 'is_finished': False, 241 'isFinished': False,
241 'is_started': True, 242 'isStarted': True,
242 'name': 'cvs', 243 'name': 'cvs',
243 'results': [[None, []], []], 244 'results': [[None, []], []],
244 'statistics': {}, 245 'statistics': {},
245 'text': ['updating'], 246 'text': ['updating'],
246 'times': [123, None], 247 'times': [123, None],
247 'urls': {} 248 'urls': {}
248 }, 249 },
249 'build': { 250 'properties': [
250 'blame': [], 251 ['branch', None, 'Build'],
251 'changes': [], 252 ['buildername', 'dummy', 'Build'],
252 'current_step': { 253 ['buildnumber', 0, 'Build'],
253 'eta': None, 254 ['revision', None, 'Build'],
254 'expectations': [], 255 ['slavename', 'bot1', 'BuildSlave']
255 'is_finished': False, 256 ],
256 'is_started': True,
257 'name': 'cvs',
258 'results': [[None, []], []],
259 'statistics': {},
260 'text': ['updating'],
261 'times': [234, None],
262 'urls': {}
263 },
264 'eta': None,
265 'number': 0,
266 'properties': [
267 ['branch', None, 'Build'],
268 ['buildername', 'dummy', 'Build'],
269 ['buildnumber', 0, 'Build'],
270 ['revision', None, 'Build'],
271 ['slavename', 'bot1', 'BuildSlave']
272 ],
273 'reason': 'forced build',
274 'requests': [
275 {
276 'builderName': 'test_builder',
277 'builds': [],
278 'source': {
279 'branch': None,
280 'changes': [],
281 'patch': None,
282 'revision': None
283 },
284 'submittedAt': 'yesterday'
285 }
286 ],
287 'results': None,
288 'slave': 'bot1',
289 'source_stamp': {
290 'branch': None,
291 'changes': [],
292 'patch': None,
293 'revision': None
294 },
295 'steps': [
296 {
297 'eta': None,
298 'expectations': [],
299 'is_finished': False,
300 'is_started': True,
301 'name': 'cvs',
302 'results': [[None, []], []],
303 'statistics': {},
304 'text': ['updating'],
305 'times': [345, None],
306 'urls': {}
307 },
308 {
309 'eta': None,
310 'expectations': [],
311 'is_finished': False,
312 'is_started': False,
313 'name': 'compile',
314 'results': [[None, []], []],
315 'statistics': {},
316 'text': ['compiling'],
317 'times': [345, None],
318 'urls': {}
319 },
320 {
321 'eta': None,
322 'expectations': [],
323 'is_finished': False,
324 'is_started': False,
325 'name': 'test',
326 'results': [[None, []], []],
327 'statistics': {},
328 'text': ['testing'],
329 'times': [345, None],
330 'urls': {}
331 }
332 ],
333 'text': [],
334 'times': [123, None]
335 }
336 } 257 }
337 }, 258 },
338 { 259 {
339 'event': 'stepFinished', 260 'event': 'stepFinished',
340 'payload': { 261 'payload': {
341 'step': { 262 'step': {
342 'eta': None, 263 'eta': None,
343 'expectations': [], 264 'expectations': [],
344 'is_finished': True, 265 'isFinished': True,
345 'is_started': True, 266 'isStarted': True,
346 'name': 'cvs', 267 'name': 'cvs',
347 'results': [2, ['cvs']], 268 'results': [2, ['cvs']],
348 'statistics': {}, 269 'statistics': {},
349 'text': ['update', 'failed'], 270 'text': ['update', 'failed'],
350 'times': [123, None], 271 'times': [123, None],
351 'urls': {} 272 'urls': {}
352 }, 273 },
353 'build': { 274 'properties': [
354 'blame': [], 275 ['branch', None, 'Build'],
355 'changes': [], 276 ['buildername', 'dummy', 'Build'],
356 'current_step': { 277 ['buildnumber', 0, 'Build'],
357 'eta': None, 278 ['revision', None, 'Build'],
358 'expectations': [], 279 ['slavename', 'bot1', 'BuildSlave']
359 'is_finished': True, 280 ],
360 'is_started': True,
361 'name': 'cvs',
362 'results': [2, ['cvs']],
363 'statistics': {},
364 'text': ['update', 'failed'],
365 'times': [234, None],
366 'urls': {}
367 },
368 'eta': None,
369 'number': 0,
370 'properties': [
371 ['branch', None, 'Build'],
372 ['buildername', 'dummy', 'Build'],
373 ['buildnumber', 0, 'Build'],
374 ['revision', None, 'Build'],
375 ['slavename', 'bot1', 'BuildSlave']
376 ],
377 'reason': 'forced build',
378 'requests': [
379 {
380 'builderName': 'test_builder',
381 'builds': [0],
382 'source': {
383 'branch': None,
384 'changes': [],
385 'patch': None,
386 'revision': None
387 },
388 'submittedAt': 'yesterday'
389 }
390 ],
391 'results': None,
392 'slave': 'bot1',
393 'source_stamp': {
394 'branch': None,
395 'changes': [],
396 'patch': None,
397 'revision': None
398 },
399 'steps': [
400 {
401 'eta': None,
402 'expectations': [],
403 'is_finished': True,
404 'is_started': True,
405 'name': 'cvs',
406 'results': [2, ['cvs']],
407 'statistics': {},
408 'text': ['update', 'failed'],
409 'times': [345, None],
410 'urls': {}
411 },
412 {
413 'eta': None,
414 'expectations': [],
415 'is_finished': False,
416 'is_started': False,
417 'name': 'compile',
418 'results': [[None, []], []],
419 'statistics': {},
420 'text': ['compiling'],
421 'times': [345, None],
422 'urls': {}
423 },
424 {
425 'eta': None,
426 'expectations': [],
427 'is_finished': False,
428 'is_started': False,
429 'name': 'test',
430 'results': [[None, []], []],
431 'statistics': {},
432 'text': ['testing'],
433 'times': [345, None],
434 'urls': {}
435 }
436 ],
437 'text': ['cvs'],
438 'times': [123, None]
439 },
440 'results': [2, ['cvs']]
441 } 281 }
442 }, 282 },
443 { 283 {
444 'event': 'buildFinished', 284 'event': 'buildFinished',
445 'payload': { 285 'payload': {
446 'results': 2,
447 'build': { 286 'build': {
448 'blame': [], 287 'blame': [],
288 'builderName': 'dummy',
449 'changes': [], 289 'changes': [],
450 'current_step': None, 290 'currentStep': None,
451 'eta': None, 291 'eta': None,
452 'number': 0, 292 'number': 0,
453 'properties': [ 293 'properties': [
454 ['branch', None, 'Build'], 294 ['branch', None, 'Build'],
455 ['buildername', 'dummy', 'Build'], 295 ['buildername', 'dummy', 'Build'],
456 ['buildnumber', 0, 'Build'], 296 ['buildnumber', 0, 'Build'],
457 ['revision', None, 'Build'], 297 ['revision', None, 'Build'],
458 ['slavename', 'bot1', 'BuildSlave'] 298 ['slavename', 'bot1', 'BuildSlave']
459 ], 299 ],
460 'reason': 'forced build', 300 'reason': 'forced build',
461 'requests': [ 301 'requests': [
462 { 302 {
463 'builderName': 'test_builder', 303 'builderName': 'test_builder',
464 'builds': [0], 304 'builds': [0],
465 'source': { 305 'source': {
466 'branch': None, 306 'branch': None,
467 'changes': [], 307 'changes': [],
468 'patch': None, 308 'patch': None,
469 'revision': None}, 309 'revision': None},
470 'submittedAt': 'yesterday' 310 'submittedAt': 'yesterday'
471 } 311 }
472 ], 312 ],
473 'results': 2, 313 'results': 2,
474 'slave': 'bot1', 314 'slave': 'bot1',
475 'source_stamp': { 315 'sourceStamp': {
476 'branch': None, 316 'branch': None,
477 'changes': [], 317 'changes': [],
478 'patch': None, 318 'patch': None,
479 'revision': None 319 'revision': None
480 }, 320 },
481 'steps': [ 321 'steps': [
482 { 322 {
483 'eta': None, 323 'eta': None,
484 'expectations': [], 324 'expectations': [],
485 'is_finished': True, 325 'isFinished': True,
486 'is_started': True, 326 'isStarted': True,
487 'name': 'cvs', 327 'name': 'cvs',
488 'results': [2, ['cvs']], 328 'results': [2, ['cvs']],
489 'statistics': {}, 329 'statistics': {},
490 'text': ['update', 'failed'], 330 'text': ['update', 'failed'],
491 'times': [345, None], 331 'times': [345, None],
492 'urls': {} 332 'urls': {}
493 }, 333 },
494 { 334 {
495 'eta': None, 335 'eta': None,
496 'expectations': [], 336 'expectations': [],
497 'is_finished': False, 337 'isFinished': False,
498 'is_started': False, 338 'isStarted': False,
499 'name': 'compile', 339 'name': 'compile',
500 'results': [[None, []], []], 340 'results': [[None, []], []],
501 'statistics': {}, 341 'statistics': {},
502 'text': ['compiling'], 342 'text': ['compiling'],
503 'times': [345, None], 343 'times': [345, None],
504 'urls': {} 344 'urls': {}
505 }, 345 },
506 { 346 {
507 'eta': None, 347 'eta': None,
508 'expectations': [], 348 'expectations': [],
509 'is_finished': False, 349 'isFinished': False,
510 'is_started': False, 350 'isStarted': False,
511 'name': 'test', 351 'name': 'test',
512 'results': [[None, []], []], 352 'results': [[None, []], []],
513 'statistics': {}, 353 'statistics': {},
514 'text': ['testing'], 354 'text': ['testing'],
515 'times': [345, None], 355 'times': [345, None],
516 'urls': {} 356 'urls': {}
517 } 357 }
518 ], 358 ],
519 'text': ['failed', 'cvs'], 359 'text': ['failed', 'cvs'],
520 'times': [123, None] 360 'times': [123, None]
521 }, 361 },
522 'builderName': 'dummy'
523 } 362 }
524 }, 363 },
525 { 364 {
526 'event': 'builderChangedState', 365 'event': 'builderChangedState',
527 'payload': { 366 'payload': {
528 'state': 'idle', 367 'state': 'idle',
529 'builderName': 'dummy' 368 'builderName': 'dummy'
530 } 369 }
531 }, 370 },
532 { 371 {
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 return d 581 return d
743 582
744 def _testBasic_3(self, d): 583 def _testBasic_3(self, d):
745 g = self.getStatusPush() 584 g = self.getStatusPush()
746 # Assert all the items were pushed. 585 # Assert all the items were pushed.
747 self.assertEqual(0, g.queue.nbItems()) 586 self.assertEqual(0, g.queue.nbItems())
748 self.verifyItems(self.site.resource.packets) 587 self.verifyItems(self.site.resource.packets)
749 self.master = None 588 self.master = None
750 589
751 # vim: set ts=4 sts=4 sw=4 et: 590 # vim: set ts=4 sts=4 sw=4 et:
OLDNEW
« no previous file with comments | « pylibs/buildbot/status/status_push.py ('k') | pylibs/buildbot/test/test_web_status_json.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698