| OLD | NEW |
| 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 Loading... |
| 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 |
| 396 buildername = 'android_one_perf_bisect' |
| 397 good_revision_hash = 'e28dc0d49c331def2a3bbf3ddd0096eb51551155' |
| 398 bad_revision_hash = 'fc6dfc7ff5b1073408499478969261b826441144' |
| 399 working_device = [ |
| 400 { |
| 401 "battery": { |
| 402 "status": "5", |
| 403 "scale": "100", |
| 404 "temperature": "249", |
| 405 "level": "100", |
| 406 "AC powered": "false", |
| 407 "health": "2", |
| 408 "voltage": "4286", |
| 409 "Wireless powered": "false", |
| 410 "USB powered": "true", |
| 411 "technology": "Li-ion", |
| 412 "present": "true" |
| 413 }, |
| 414 "wifi_ip": "", |
| 415 "imei_slice": "Unknown", |
| 416 "ro.build.id": "LRX21O", |
| 417 "ro.build.product": "product_name", |
| 418 "build_detail": |
| 419 "google/razor/flo:5.0/LRX21O/1570415:userdebug/dev-keys", |
| 420 "serial": "1111", |
| 421 "adb_status": "device", |
| 422 "blacklisted": False, |
| 423 "usb_status": True, |
| 424 }, |
| 425 { |
| 426 "adb_status": "offline", |
| 427 "blacklisted": True, |
| 428 "serial": "03e0363a003c6ad4", |
| 429 "usb_status": False, |
| 430 }, |
| 431 { |
| 432 "adb_status": "unauthorized", |
| 433 "blacklisted": True, |
| 434 "serial": "03e0363a003c6ad5", |
| 435 "usb_status": True, |
| 436 }, |
| 437 { |
| 438 "adb_status": "device", |
| 439 "blacklisted": True, |
| 440 "serial": "03e0363a003c6ad6", |
| 441 "usb_status": True, |
| 442 } |
| 443 ] |
| 444 |
| 445 two_devices = [ |
| 446 { |
| 447 "battery": { |
| 448 "status": "5", |
| 449 "scale": "100", |
| 450 "temperature": "249", |
| 451 "level": "100", |
| 452 "AC powered": "false", |
| 453 "health": "2", |
| 454 "voltage": "4286", |
| 455 "Wireless powered": "false", |
| 456 "USB powered": "true", |
| 457 "technology": "Li-ion", |
| 458 "present": "true" |
| 459 }, |
| 460 "wifi_ip": "", |
| 461 "imei_slice": "Unknown", |
| 462 "ro.build.id": "LRX21O", |
| 463 "ro.build.product": "product_name", |
| 464 "build_detail": |
| 465 "google/razor/flo:5.0/LRX21O/1570415:userdebug/dev-keys", |
| 466 "serial": "2222", |
| 467 "adb_status": "device", |
| 468 "blacklisted": False, |
| 469 "usb_status": True, |
| 470 }, |
| 471 { |
| 472 "battery": { |
| 473 "status": "5", |
| 474 "scale": "100", |
| 475 "temperature": "249", |
| 476 "level": "100", |
| 477 "AC powered": "false", |
| 478 "health": "2", |
| 479 "voltage": "4286", |
| 480 "Wireless powered": "false", |
| 481 "USB powered": "true", |
| 482 "technology": "Li-ion", |
| 483 "present": "true" |
| 484 }, |
| 485 "wifi_ip": "", |
| 486 "imei_slice": "Unknown", |
| 487 "ro.build.id": "LRX21O", |
| 488 "ro.build.product": "product_name", |
| 489 "build_detail": |
| 490 "google/razor/flo:5.0/LRX21O/1570415:userdebug/dev-keys", |
| 491 "serial": "1111", |
| 492 "adb_status": "device", |
| 493 "blacklisted": False, |
| 494 "usb_status": True, |
| 495 }, |
| 496 { |
| 497 "adb_status": "offline", |
| 498 "blacklisted": True, |
| 499 "serial": "03e0363a003c6ad4", |
| 500 "usb_status": False, |
| 501 }, |
| 502 { |
| 503 "adb_status": "unauthorized", |
| 504 "blacklisted": True, |
| 505 "serial": "03e0363a003c6ad5", |
| 506 "usb_status": True, |
| 507 }, |
| 508 { |
| 509 "adb_status": "device", |
| 510 "blacklisted": True, |
| 511 "serial": "03e0363a003c6ad6", |
| 512 "usb_status": True, |
| 513 } |
| 514 ] |
| 515 |
| 516 # simulate the scenario when the first tested device works |
| 517 yield (api.test('local_basic_recipe_basic_device') + |
| 518 api.properties.tryserver( |
| 519 mastername='tryserver.chromium.perf', buildername=buildername) + |
| 520 api.properties( |
| 521 bisect_config=local_bisect_config, |
| 522 job_name='f7a7b4135624439cbd27fdd5133d74ec', |
| 523 local_test=True, |
| 524 parent_got_revision='1111111', |
| 525 parent_build_archive_url='gs://test-domain/test-archive.zip') + |
| 526 api.bisect_tester(tempfile='/tmp/dummy') + |
| 527 api.step_data( |
| 528 'Gathering reference values.saving json to temp file', |
| 529 stdout=api.raw_io.output('/tmp/dummy3')) + |
| 530 api.step_data( |
| 531 'Gathering reference values.saving json to temp file (2)', |
| 532 stdout=api.raw_io.output('/tmp/dummy4')) + |
| 533 api.override_step_data('device_status', |
| 534 api.json.output(working_device)) + |
| 535 api.override_step_data('device_status (2)', |
| 536 api.json.output(working_device)) + |
| 537 api.step_data('Resolving reference range.crrev get commit hash for ' + |
| 538 ('refs/heads/master@{#%s}' % local_bisect_config['bad_revision']), |
| 539 stdout=api.json.output( |
| 540 {'git_sha': bad_revision_hash}))+ |
| 541 api.step_data('Resolving reference range.crrev get commit hash for ' + |
| 542 ('refs/heads/master@{#%s}' % local_bisect_config[ |
| 543 'good_revision']), |
| 544 stdout=api.json.output( |
| 545 {'git_sha': good_revision_hash}))+ |
| 546 api.step_data('Expanding revision range.for revisions %s:%s' % ( |
| 547 good_revision_hash, bad_revision_hash), |
| 548 stdout=api.json.output([[bad_revision_hash, 'ignored'], |
| 549 [good_revision_hash, 'ignored']])) + |
| 550 api.step_data('Post bisect results', |
| 551 stdout=api.json.output({'status_code': 200}))) |
| 552 |
| 553 # simulate the scenario when the no device is connected. |
| 554 yield (api.test('local_basic_recipe_no_device') + |
| 555 api.properties.tryserver( |
| 556 mastername='tryserver.chromium.perf', buildername=buildername) + |
| 557 api.properties( |
| 558 bisect_config=local_bisect_config, |
| 559 job_name='f7a7b4135624439cbd27fdd5133d74ec', |
| 560 local_test=True, |
| 561 parent_got_revision='1111111', |
| 562 parent_build_archive_url='gs://test-domain/test-archive.zip') + |
| 563 api.bisect_tester(tempfile='/tmp/dummy') + |
| 564 api.override_step_data('device_status', api.json.output([])) + |
| 565 api.override_step_data('device_status (2)', api.json.output([]))) |
| 566 |
| 567 # simulate the scenario when tests fail not because of device |
| 568 # disconnection. |
| 569 yield (api.test('local_basic_recipe_failed_device') + |
| 570 api.properties.tryserver( |
| 571 mastername='tryserver.chromium.perf', buildername=buildername) + |
| 572 api.properties( |
| 573 bisect_config=local_bisect_config, |
| 574 job_name='f7a7b4135624439cbd27fdd5133d74ec', |
| 575 local_test=True, |
| 576 parent_got_revision='1111111', |
| 577 parent_build_archive_url='gs://test-domain/test-archive.zip') + |
| 578 api.bisect_tester(tempfile='/tmp/dummy') + |
| 579 api.step_data( |
| 580 'Gathering reference values.saving json to temp file', |
| 581 stdout=api.raw_io.output('/tmp/dummy3')) + |
| 582 api.step_data( |
| 583 'Gathering reference values.saving json to temp file (2)', |
| 584 stdout=api.raw_io.output('/tmp/dummy4')) + |
| 585 api.override_step_data('device_status', |
| 586 api.json.output(working_device)) + |
| 587 api.override_step_data('device_status (2)', |
| 588 api.json.output(working_device)) + |
| 589 api.step_data('Resolving reference range.crrev get commit hash for ' + |
| 590 ('refs/heads/master@{#%s}' % local_bisect_config['bad_revision']), |
| 591 stdout=api.json.output( |
| 592 {'git_sha': bad_revision_hash}))+ |
| 593 api.step_data('Resolving reference range.crrev get commit hash for ' + |
| 594 ('refs/heads/master@{#%s}' % local_bisect_config[ |
| 595 'good_revision']), |
| 596 stdout=api.json.output( |
| 597 {'git_sha': good_revision_hash}))+ |
| 598 api.step_data('Expanding revision range.for revisions %s:%s' % ( |
| 599 good_revision_hash, bad_revision_hash), |
| 600 stdout=api.json.output([[bad_revision_hash, 'ignored'], |
| 601 [good_revision_hash, 'ignored']])) + |
| 602 api.step_data('Post bisect results', retcode=1) + |
| 603 api.override_step_data('device_status (3)', |
| 604 api.json.output(working_device))) |
| 605 |
| 606 # simulate the scenario when tests fail because of device disconnection. |
| 607 yield (api.test('local_basic_recipe_disconnected_device') + |
| 608 api.properties.tryserver( |
| 609 mastername='tryserver.chromium.perf', buildername=buildername) + |
| 610 api.properties( |
| 611 bisect_config=local_bisect_config, |
| 612 job_name='f7a7b4135624439cbd27fdd5133d74ec', |
| 613 local_test=True, |
| 614 parent_got_revision='1111111', |
| 615 parent_build_archive_url='gs://test-domain/test-archive.zip') + |
| 616 api.bisect_tester(tempfile='/tmp/dummy') + |
| 617 api.step_data( |
| 618 'Gathering reference values.saving json to temp file', |
| 619 stdout=api.raw_io.output('/tmp/dummy3')) + |
| 620 api.step_data( |
| 621 'Gathering reference values.saving json to temp file (2)', |
| 622 stdout=api.raw_io.output('/tmp/dummy4')) + |
| 623 api.step_data( |
| 624 'Gathering reference values.saving json to temp file (3)', |
| 625 stdout=api.raw_io.output('/tmp/dummy5')) + |
| 626 api.step_data( |
| 627 'Gathering reference values.saving json to temp file (4)', |
| 628 stdout=api.raw_io.output('/tmp/dummy6')) + |
| 629 api.override_step_data('device_status', |
| 630 api.json.output(two_devices)) + |
| 631 api.override_step_data('device_status (2)', |
| 632 api.json.output(two_devices)) + |
| 633 api.step_data('Resolving reference range.crrev get commit hash for ' + |
| 634 ('refs/heads/master@{#%s}' % local_bisect_config['bad_revision']), |
| 635 stdout=api.json.output( |
| 636 {'git_sha': bad_revision_hash}))+ |
| 637 api.step_data('Resolving reference range.crrev get commit hash for ' + |
| 638 ('refs/heads/master@{#%s}' % local_bisect_config[ |
| 639 'good_revision']), |
| 640 stdout=api.json.output( |
| 641 {'git_sha': good_revision_hash}))+ |
| 642 api.step_data('Expanding revision range.for revisions %s:%s' % ( |
| 643 good_revision_hash, bad_revision_hash), |
| 644 stdout=api.json.output([[bad_revision_hash, 'ignored'], [ |
| 645 good_revision_hash, 'ignored']])) + |
| 646 # Simulating disconnect by raising failure and changing the output of |
| 647 # multiple_device_status |
| 648 api.step_data('Post bisect results', retcode=1) + |
| 649 api.override_step_data('device_status (3)', |
| 650 api.json.output(working_device)) + |
| 651 api.step_data('Resolving reference range.crrev get commit hash for ' + |
| 652 ('refs/heads/master@{#%s} (2)' % local_bisect_config[ |
| 653 'bad_revision']), |
| 654 stdout=api.json.output( |
| 655 {'git_sha': bad_revision_hash}))+ |
| 656 api.step_data('Resolving reference range.crrev get commit hash for ' + |
| 657 ('refs/heads/master@{#%s} (2)' % local_bisect_config[ |
| 658 'good_revision']), |
| 659 stdout=api.json.output( |
| 660 {'git_sha': good_revision_hash}))+ |
| 661 api.step_data('Expanding revision range.for revisions %s:%s (2)' % ( |
| 662 good_revision_hash, bad_revision_hash), |
| 663 stdout=api.json.output([[bad_revision_hash, 'ignored'], [ |
| 664 good_revision_hash, 'ignored']])) + |
| 665 api.step_data('Post bisect results (2)', |
| 666 stdout=api.json.output({'status_code': 200}))) |
| OLD | NEW |