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