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

Side by Side Diff: scripts/slave/recipes/bisection/android_bisect.py

Issue 2119483003: Reland "Allow multiple devices on bisects hosts " (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Remove empty change to revision_state.py Created 4 years, 5 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
OLDNEW
1 # Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 from recipe_engine.types import freeze 5 from recipe_engine.types import freeze
6 6
7 DEPS = [ 7 DEPS = [
8 'auto_bisect', 8 'auto_bisect',
9 'bisect_tester', 9 'bisect_tester',
10 'depot_tools/bot_update', 10 'depot_tools/bot_update',
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 'test_type': 'perf', 350 'test_type': 'perf',
351 'command': './tools/perf/run_benchmark -v ' 351 'command': './tools/perf/run_benchmark -v '
352 '--browser=android-chromium page_cycler.intl_ar_fa_he', 352 '--browser=android-chromium page_cycler.intl_ar_fa_he',
353 'metric': 'warm_times/page_load_time', 353 'metric': 'warm_times/page_load_time',
354 'repeat_count': '2', 354 'repeat_count': '2',
355 'max_time_minutes': '5', 355 'max_time_minutes': '5',
356 'truncate_percent': '25', 356 'truncate_percent': '25',
357 'bug_id': '425582', 357 'bug_id': '425582',
358 'gs_bucket': 'chrome-perf', 358 'gs_bucket': 'chrome-perf',
359 'builder_host': 'master4.golo.chromium.org', 359 'builder_host': 'master4.golo.chromium.org',
360 'builder_port': '8341', 360 'builder_port': '8341'
361 } 361 }
362 yield (api.test('basic_recipe_' + buildername) + api.properties.tryserver( 362 yield (api.test('basic_recipe_' + buildername) +
363 mastername='tryserver.chromium.perf', 363 api.properties.tryserver(
364 buildername=buildername) + api.step_data( 364 mastername='tryserver.chromium.perf',
365 buildername=buildername) +
366 api.step_data(
365 'saving url to temp file', 367 'saving url to temp file',
366 stdout=api.raw_io.output('/tmp/dummy1')) + api.step_data( 368 stdout=api.raw_io.output('/tmp/dummy1')) +
367 'saving json to temp file', 369 api.step_data(
368 stdout=api.raw_io.output('/tmp/dummy2')) + api.properties( 370 'saving json to temp file',
371 stdout=api.raw_io.output('/tmp/dummy2')) +
372 api.properties(
369 bisect_config=bisect_config) + api.properties( 373 bisect_config=bisect_config) + api.properties(
370 job_name='f7a7b4135624439cbd27fdd5133d74ec') + 374 job_name='f7a7b4135624439cbd27fdd5133d74ec') +
371 api.bisect_tester(tempfile='/tmp/dummy') + 375 api.bisect_tester(tempfile='/tmp/dummy') +
372 api.properties(parent_got_revision='1111111') + api.properties( 376 api.properties(parent_got_revision='1111111') + api.properties(
373 parent_build_archive_url='gs://test-domain/test-archive.zip')) 377 parent_build_archive_url='gs://test-domain/test-archive.zip'))
378
379 local_bisect_config = {
380 'test_type': 'perf',
381 'command': './tools/perf/run_benchmark -v '
382 '--browser=android-chromium page_cycler.intl_ar_fa_he',
383 'metric': 'warm_times/page_load_time',
384 'repeat_count': '2',
385 'max_time_minutes': '5',
386 'truncate_percent': '25',
387 'bug_id': '425582',
388 'gs_bucket': 'chrome-perf',
389 'builder_host': 'master4.golo.chromium.org',
390 'builder_port': '8341',
391 'good_revision': '306475',
392 'bad_revision': '306476',
393 'dummy_job_names': True
394 }
395 good_revision_hash = 'e28dc0d49c331def2a3bbf3ddd0096eb51551155'
396 bad_revision_hash = 'fc6dfc7ff5b1073408499478969261b826441144'
397 working_device = [
398 {
399 "battery": {
400 "status": "5",
401 "scale": "100",
402 "temperature": "249",
403 "level": "100",
404 "AC powered": "false",
405 "health": "2",
406 "voltage": "4286",
407 "Wireless powered": "false",
408 "USB powered": "true",
409 "technology": "Li-ion",
410 "present": "true"
411 },
412 "wifi_ip": "",
413 "imei_slice": "Unknown",
414 "ro.build.id": "LRX21O",
415 "ro.build.product": "product_name",
416 "build_detail":
417 "google/razor/flo:5.0/LRX21O/1570415:userdebug/dev-keys",
418 "serial": "1111",
419 "adb_status": "device",
420 "blacklisted": False,
421 "usb_status": True,
422 },
423 {
424 "adb_status": "offline",
425 "blacklisted": True,
426 "serial": "03e0363a003c6ad4",
427 "usb_status": False,
428 },
429 {
430 "adb_status": "unauthorized",
431 "blacklisted": True,
432 "serial": "03e0363a003c6ad5",
433 "usb_status": True,
434 },
435 {
436 "adb_status": "device",
437 "blacklisted": True,
438 "serial": "03e0363a003c6ad6",
439 "usb_status": True,
440 }
441 ]
442
443 bad_device = [
444
445 {
446 "battery": {
447 "status": "5",
448 "scale": "100",
449 "temperature": "249",
450 "level": "100",
451 "AC powered": "false",
452 "health": "2",
453 "voltage": "4286",
454 "Wireless powered": "false",
455 "USB powered": "true",
456 "technology": "Li-ion",
457 "present": "true"
458 },
459 "wifi_ip": "",
460 "imei_slice": "Unknown",
461 "ro.build.id": "LRX21O",
462 "ro.build.product": "product_name",
463 "build_detail":
464 "google/razor/flo:5.0/LRX21O/1570415:userdebug/dev-keys",
465 "serial": "2222",
466 "adb_status": "device",
467 "blacklisted": False,
468 "usb_status": True,
469 },
470 {
471 "adb_status": "offline",
472 "blacklisted": True,
473 "serial": "03e0363a003c6ad4",
474 "usb_status": False,
475 },
476 {
477 "adb_status": "unauthorized",
478 "blacklisted": True,
479 "serial": "03e0363a003c6ad5",
480 "usb_status": True,
481 },
482 {
483 "adb_status": "device",
484 "blacklisted": True,
485 "serial": "03e0363a003c6ad6",
486 "usb_status": True,
487 }
488 ]
489
490 # simulate the scenario when the first tested device works
491 yield (api.test('local_basic_recipe_basic_device_' + buildername) +
492 api.properties.tryserver(
493 mastername='tryserver.chromium.perf', buildername=buildername) +
494 api.properties(
495 bisect_config=local_bisect_config) + api.properties(
496 job_name='f7a7b4135624439cbd27fdd5133d74ec',
497 buildnumber='8923hf89h3f8h29820j2d') +
498 api.properties(parent_got_revision='1111111') + api.properties(
499 parent_build_archive_url='gs://test-domain/test-archive.zip') +
500 api.bisect_tester(tempfile='/tmp/dummy') +
501 api.override_step_data('multiple_device_status',
502 api.json.output(working_device)) +
503 api.step_data('Resolving reference range.crrev get commit hash for ' +
504 ('refs/heads/master@{#%s}' % local_bisect_config['bad_revision']),
505 stdout=api.json.output(
506 {'git_sha': bad_revision_hash}))+
507 api.step_data('Resolving reference range.crrev get commit hash for ' +
508 ('refs/heads/master@{#%s}' % local_bisect_config[
509 'good_revision']),
510 stdout=api.json.output(
511 {'git_sha': good_revision_hash}))+
512 api.step_data('Expanding revision range.for revisions %s:%s' % (
513 good_revision_hash, bad_revision_hash),
514 stdout=api.json.output([[bad_revision_hash, 'ignored'],
515 [good_revision_hash, 'ignored']])) +
516 api.step_data('Post bisect results',
517 stdout=api.json.output({'status_code': 200})))
518
519 # simulate the scenario when the no device is connected.
520 yield (api.test('local_basic_recipe_no_device_' + buildername) +
521 api.properties.tryserver(
522 mastername='tryserver.chromium.perf', buildername=buildername) +
523 api.properties(
524 bisect_config=local_bisect_config) + api.properties(
525 job_name='f7a7b4135624439cbd27fdd5133d74ec') +
526 api.properties(parent_got_revision='1111111') + api.properties(
527 parent_build_archive_url='gs://test-domain/test-archive.zip') +
528 api.bisect_tester(tempfile='/tmp/dummy') +
529 api.override_step_data('multiple_device_status',
530 api.json.output([])))
531
532 # simulate the scenario when tests fail not because of device
533 # disconnection.
534 yield (api.test('local_basic_recipe_failed_device_' + buildername) +
535 api.properties.tryserver(
536 mastername='tryserver.chromium.perf', buildername=buildername) +
537 api.properties(
538 bisect_config=local_bisect_config) + api.properties(
539 job_name='f7a7b4135624439cbd27fdd5133d74ec') +
540 api.properties(parent_got_revision='1111111') + api.properties(
541 parent_build_archive_url='gs://test-domain/test-archive.zip') +
542 api.bisect_tester(tempfile='/tmp/dummy') +
543 api.override_step_data('multiple_device_status',
544 api.json.output(working_device)) +
545 api.step_data('Resolving reference range.crrev get commit hash for ' +
546 ('refs/heads/master@{#%s}' % local_bisect_config['bad_revision']),
547 stdout=api.json.output(
548 {'git_sha': bad_revision_hash}))+
549 api.step_data('Resolving reference range.crrev get commit hash for ' +
550 ('refs/heads/master@{#%s}' % local_bisect_config[
551 'good_revision']),
552 stdout=api.json.output(
553 {'git_sha': good_revision_hash}))+
554 api.step_data('Expanding revision range.for revisions %s:%s' % (
555 good_revision_hash, bad_revision_hash),
556 stdout=api.json.output([[bad_revision_hash, 'ignored'],
557 [good_revision_hash, 'ignored']])) +
558 api.step_data('Post bisect results', retcode=1) +
559 api.override_step_data('multiple_device_status (2)',
560 api.json.output(working_device)))
561
562 # simulate the scenario when tests fail because of device disconnection.
563 yield (api.test('local_basic_recipe_disconnected_device_' + buildername) +
564 api.properties.tryserver(
565 mastername='tryserver.chromium.perf', buildername=buildername) +
566 api.properties(
567 bisect_config=local_bisect_config) + api.properties(
568 job_name='f7a7b4135624439cbd27fdd5133d74ec') +
569 api.properties(parent_got_revision='1111111') + api.properties(
570 parent_build_archive_url='gs://test-domain/test-archive.zip') +
571 api.bisect_tester(tempfile='/tmp/dummy') +
572 api.override_step_data('multiple_device_status',
573 api.json.output(bad_device)) +
574 api.step_data('Resolving reference range.crrev get commit hash for ' +
575 ('refs/heads/master@{#%s}' % local_bisect_config['bad_revision']),
576 stdout=api.json.output(
577 {'git_sha': bad_revision_hash}))+
578 api.step_data('Resolving reference range.crrev get commit hash for ' +
579 ('refs/heads/master@{#%s}' % local_bisect_config[
580 'good_revision']),
581 stdout=api.json.output(
582 {'git_sha': good_revision_hash}))+
583 api.step_data('Expanding revision range.for revisions %s:%s' % (
584 good_revision_hash, bad_revision_hash),
585 stdout=api.json.output([[bad_revision_hash, 'ignored'], [
586 good_revision_hash, 'ignored']])) +
587 api.step_data('Post bisect results', retcode=1) +
RobertoCN 2016/07/14 23:46:03 # Simulating disconnect by raising failure and cha
588 api.override_step_data('multiple_device_status (2)',
589 api.json.output(working_device)) +
590 api.override_step_data('multiple_device_status (3)',
591 api.json.output(working_device)) +
592 api.step_data('Resolving reference range.crrev get commit hash for ' +
593 ('refs/heads/master@{#%s} (2)' % local_bisect_config[
594 'bad_revision']),
595 stdout=api.json.output(
596 {'git_sha': bad_revision_hash}))+
597 api.step_data('Resolving reference range.crrev get commit hash for ' +
598 ('refs/heads/master@{#%s} (2)' % local_bisect_config[
599 'good_revision']),
600 stdout=api.json.output(
601 {'git_sha': good_revision_hash}))+
602 api.step_data('Expanding revision range.for revisions %s:%s (2)' % (
603 good_revision_hash, bad_revision_hash),
604 stdout=api.json.output([[bad_revision_hash, 'ignored'], [
605 good_revision_hash, 'ignored']])) +
606 api.step_data('Post bisect results (2)',
607 stdout=api.json.output({'status_code': 200})))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698