| 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 bad_device = [ |
| 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 "adb_status": "offline", |
| 473 "blacklisted": True, |
| 474 "serial": "03e0363a003c6ad4", |
| 475 "usb_status": False, |
| 476 }, |
| 477 { |
| 478 "adb_status": "unauthorized", |
| 479 "blacklisted": True, |
| 480 "serial": "03e0363a003c6ad5", |
| 481 "usb_status": True, |
| 482 }, |
| 483 { |
| 484 "adb_status": "device", |
| 485 "blacklisted": True, |
| 486 "serial": "03e0363a003c6ad6", |
| 487 "usb_status": True, |
| 488 } |
| 489 ] |
| 490 |
| 491 # simulate the scenario when the first tested device works |
| 492 yield (api.test('local_basic_recipe_basic_device') + |
| 493 api.properties.tryserver( |
| 494 mastername='tryserver.chromium.perf', buildername=buildername) + |
| 495 api.properties( |
| 496 bisect_config=local_bisect_config, |
| 497 job_name='f7a7b4135624439cbd27fdd5133d74ec', |
| 498 local_test=True, |
| 499 parent_got_revision='1111111', |
| 500 parent_build_archive_url='gs://test-domain/test-archive.zip') + |
| 501 api.bisect_tester(tempfile='/tmp/dummy') + |
| 502 api.step_data( |
| 503 'Gathering reference values.saving json to temp file', |
| 504 stdout=api.raw_io.output('/tmp/dummy3')) + |
| 505 api.step_data( |
| 506 'Gathering reference values.saving json to temp file (2)', |
| 507 stdout=api.raw_io.output('/tmp/dummy4')) + |
| 508 api.override_step_data('multiple_device_status', |
| 509 api.json.output(working_device)) + |
| 510 api.step_data('Resolving reference range.crrev get commit hash for ' + |
| 511 ('refs/heads/master@{#%s}' % local_bisect_config['bad_revision']), |
| 512 stdout=api.json.output( |
| 513 {'git_sha': bad_revision_hash}))+ |
| 514 api.step_data('Resolving reference range.crrev get commit hash for ' + |
| 515 ('refs/heads/master@{#%s}' % local_bisect_config[ |
| 516 'good_revision']), |
| 517 stdout=api.json.output( |
| 518 {'git_sha': good_revision_hash}))+ |
| 519 api.step_data('Expanding revision range.for revisions %s:%s' % ( |
| 520 good_revision_hash, bad_revision_hash), |
| 521 stdout=api.json.output([[bad_revision_hash, 'ignored'], |
| 522 [good_revision_hash, 'ignored']])) + |
| 523 api.step_data('Post bisect results', |
| 524 stdout=api.json.output({'status_code': 200}))) |
| 525 |
| 526 # simulate the scenario when the no device is connected. |
| 527 yield (api.test('local_basic_recipe_no_device') + |
| 528 api.properties.tryserver( |
| 529 mastername='tryserver.chromium.perf', buildername=buildername) + |
| 530 api.properties( |
| 531 bisect_config=local_bisect_config, |
| 532 job_name='f7a7b4135624439cbd27fdd5133d74ec', |
| 533 local_test=True, |
| 534 parent_got_revision='1111111', |
| 535 parent_build_archive_url='gs://test-domain/test-archive.zip') + |
| 536 api.bisect_tester(tempfile='/tmp/dummy') + |
| 537 api.override_step_data('multiple_device_status', |
| 538 api.json.output([]))) |
| 539 |
| 540 # simulate the scenario when tests fail not because of device |
| 541 # disconnection. |
| 542 yield (api.test('local_basic_recipe_failed_device') + |
| 543 api.properties.tryserver( |
| 544 mastername='tryserver.chromium.perf', buildername=buildername) + |
| 545 api.properties( |
| 546 bisect_config=local_bisect_config, |
| 547 job_name='f7a7b4135624439cbd27fdd5133d74ec', |
| 548 local_test=True, |
| 549 parent_got_revision='1111111', |
| 550 parent_build_archive_url='gs://test-domain/test-archive.zip') + |
| 551 api.bisect_tester(tempfile='/tmp/dummy') + |
| 552 api.step_data( |
| 553 'Gathering reference values.saving json to temp file', |
| 554 stdout=api.raw_io.output('/tmp/dummy3')) + |
| 555 api.step_data( |
| 556 'Gathering reference values.saving json to temp file (2)', |
| 557 stdout=api.raw_io.output('/tmp/dummy4')) + |
| 558 api.override_step_data('multiple_device_status', |
| 559 api.json.output(working_device)) + |
| 560 api.step_data('Resolving reference range.crrev get commit hash for ' + |
| 561 ('refs/heads/master@{#%s}' % local_bisect_config['bad_revision']), |
| 562 stdout=api.json.output( |
| 563 {'git_sha': bad_revision_hash}))+ |
| 564 api.step_data('Resolving reference range.crrev get commit hash for ' + |
| 565 ('refs/heads/master@{#%s}' % local_bisect_config[ |
| 566 'good_revision']), |
| 567 stdout=api.json.output( |
| 568 {'git_sha': good_revision_hash}))+ |
| 569 api.step_data('Expanding revision range.for revisions %s:%s' % ( |
| 570 good_revision_hash, bad_revision_hash), |
| 571 stdout=api.json.output([[bad_revision_hash, 'ignored'], |
| 572 [good_revision_hash, 'ignored']])) + |
| 573 api.step_data('Post bisect results', retcode=1) + |
| 574 api.override_step_data('multiple_device_status (2)', |
| 575 api.json.output(working_device))) |
| 576 |
| 577 # simulate the scenario when tests fail because of device disconnection. |
| 578 yield (api.test('local_basic_recipe_disconnected_device') + |
| 579 api.properties.tryserver( |
| 580 mastername='tryserver.chromium.perf', buildername=buildername) + |
| 581 api.properties( |
| 582 bisect_config=local_bisect_config, |
| 583 job_name='f7a7b4135624439cbd27fdd5133d74ec', |
| 584 local_test=True, |
| 585 parent_got_revision='1111111', |
| 586 parent_build_archive_url='gs://test-domain/test-archive.zip') + |
| 587 api.bisect_tester(tempfile='/tmp/dummy') + |
| 588 api.step_data( |
| 589 'Gathering reference values.saving json to temp file', |
| 590 stdout=api.raw_io.output('/tmp/dummy3')) + |
| 591 api.step_data( |
| 592 'Gathering reference values.saving json to temp file (2)', |
| 593 stdout=api.raw_io.output('/tmp/dummy4')) + |
| 594 api.step_data( |
| 595 'Gathering reference values.saving json to temp file (3)', |
| 596 stdout=api.raw_io.output('/tmp/dummy5')) + |
| 597 api.step_data( |
| 598 'Gathering reference values.saving json to temp file (4)', |
| 599 stdout=api.raw_io.output('/tmp/dummy6')) + |
| 600 api.override_step_data('multiple_device_status', |
| 601 api.json.output(bad_device)) + |
| 602 api.step_data('Resolving reference range.crrev get commit hash for ' + |
| 603 ('refs/heads/master@{#%s}' % local_bisect_config['bad_revision']), |
| 604 stdout=api.json.output( |
| 605 {'git_sha': bad_revision_hash}))+ |
| 606 api.step_data('Resolving reference range.crrev get commit hash for ' + |
| 607 ('refs/heads/master@{#%s}' % local_bisect_config[ |
| 608 'good_revision']), |
| 609 stdout=api.json.output( |
| 610 {'git_sha': good_revision_hash}))+ |
| 611 api.step_data('Expanding revision range.for revisions %s:%s' % ( |
| 612 good_revision_hash, bad_revision_hash), |
| 613 stdout=api.json.output([[bad_revision_hash, 'ignored'], [ |
| 614 good_revision_hash, 'ignored']])) + |
| 615 # Simulating disconnect by raising failure and changing the output of |
| 616 # multiple_device_status |
| 617 api.step_data('Post bisect results', retcode=1) + |
| 618 api.override_step_data('multiple_device_status (2)', |
| 619 api.json.output(working_device)) + |
| 620 api.override_step_data('multiple_device_status (3)', |
| 621 api.json.output(working_device)) + |
| 622 api.step_data('Resolving reference range.crrev get commit hash for ' + |
| 623 ('refs/heads/master@{#%s} (2)' % local_bisect_config[ |
| 624 'bad_revision']), |
| 625 stdout=api.json.output( |
| 626 {'git_sha': bad_revision_hash}))+ |
| 627 api.step_data('Resolving reference range.crrev get commit hash for ' + |
| 628 ('refs/heads/master@{#%s} (2)' % local_bisect_config[ |
| 629 'good_revision']), |
| 630 stdout=api.json.output( |
| 631 {'git_sha': good_revision_hash}))+ |
| 632 api.step_data('Expanding revision range.for revisions %s:%s (2)' % ( |
| 633 good_revision_hash, bad_revision_hash), |
| 634 stdout=api.json.output([[bad_revision_hash, 'ignored'], [ |
| 635 good_revision_hash, 'ignored']])) + |
| 636 api.step_data('Post bisect results (2)', |
| 637 stdout=api.json.output({'status_code': 200}))) |
| OLD | NEW |