Chromium Code Reviews| Index: scripts/slave/recipes/bisection/android_bisect.py |
| diff --git a/scripts/slave/recipes/bisection/android_bisect.py b/scripts/slave/recipes/bisection/android_bisect.py |
| index 294c42851a19a6166e616d68c2e78fdd51ea5986..c17e36a74bdf01e588124665c3e60eae41e61090 100644 |
| --- a/scripts/slave/recipes/bisection/android_bisect.py |
| +++ b/scripts/slave/recipes/bisection/android_bisect.py |
| @@ -357,17 +357,251 @@ results-without_patch |
| 'bug_id': '425582', |
| 'gs_bucket': 'chrome-perf', |
| 'builder_host': 'master4.golo.chromium.org', |
| - 'builder_port': '8341', |
| + 'builder_port': '8341' |
| } |
| - yield (api.test('basic_recipe_' + buildername) + api.properties.tryserver( |
| - mastername='tryserver.chromium.perf', |
| - buildername=buildername) + api.step_data( |
| + yield (api.test('basic_recipe_' + buildername) + |
| + api.properties.tryserver( |
| + mastername='tryserver.chromium.perf', |
| + buildername=buildername) + |
| + api.step_data( |
| 'saving url to temp file', |
| - stdout=api.raw_io.output('/tmp/dummy1')) + api.step_data( |
| - 'saving json to temp file', |
| - stdout=api.raw_io.output('/tmp/dummy2')) + api.properties( |
| + stdout=api.raw_io.output('/tmp/dummy1')) + |
| + api.step_data( |
| + 'saving json to temp file', |
| + stdout=api.raw_io.output('/tmp/dummy2')) + |
| + api.properties( |
| bisect_config=bisect_config) + api.properties( |
| job_name='f7a7b4135624439cbd27fdd5133d74ec') + |
| api.bisect_tester(tempfile='/tmp/dummy') + |
| api.properties(parent_got_revision='1111111') + api.properties( |
| parent_build_archive_url='gs://test-domain/test-archive.zip')) |
| + |
| + local_bisect_config = { |
| + 'test_type': 'perf', |
| + 'command': './tools/perf/run_benchmark -v ' |
| + '--browser=android-chromium page_cycler.intl_ar_fa_he', |
| + 'metric': 'warm_times/page_load_time', |
| + 'repeat_count': '2', |
| + 'max_time_minutes': '5', |
| + 'truncate_percent': '25', |
| + 'bug_id': '425582', |
| + 'gs_bucket': 'chrome-perf', |
| + 'builder_host': 'master4.golo.chromium.org', |
| + 'builder_port': '8341', |
| + 'good_revision': '306475', |
| + 'bad_revision': '306476', |
| + 'dummy_job_names': True |
| + } |
| + good_revision_hash = 'e28dc0d49c331def2a3bbf3ddd0096eb51551155' |
| + bad_revision_hash = 'fc6dfc7ff5b1073408499478969261b826441144' |
| + working_device = [ |
| + { |
| + "battery": { |
| + "status": "5", |
| + "scale": "100", |
| + "temperature": "249", |
| + "level": "100", |
| + "AC powered": "false", |
| + "health": "2", |
| + "voltage": "4286", |
| + "Wireless powered": "false", |
| + "USB powered": "true", |
| + "technology": "Li-ion", |
| + "present": "true" |
| + }, |
| + "wifi_ip": "", |
| + "imei_slice": "Unknown", |
| + "ro.build.id": "LRX21O", |
| + "ro.build.product": "product_name", |
| + "build_detail": |
| + "google/razor/flo:5.0/LRX21O/1570415:userdebug/dev-keys", |
| + "serial": "1111", |
| + "adb_status": "device", |
| + "blacklisted": False, |
| + "usb_status": True, |
| + }, |
| + { |
| + "adb_status": "offline", |
| + "blacklisted": True, |
| + "serial": "03e0363a003c6ad4", |
| + "usb_status": False, |
| + }, |
| + { |
| + "adb_status": "unauthorized", |
| + "blacklisted": True, |
| + "serial": "03e0363a003c6ad5", |
| + "usb_status": True, |
| + }, |
| + { |
| + "adb_status": "device", |
| + "blacklisted": True, |
| + "serial": "03e0363a003c6ad6", |
| + "usb_status": True, |
| + } |
| + ] |
| + |
| + bad_device = [ |
| + |
| + { |
| + "battery": { |
| + "status": "5", |
| + "scale": "100", |
| + "temperature": "249", |
| + "level": "100", |
| + "AC powered": "false", |
| + "health": "2", |
| + "voltage": "4286", |
| + "Wireless powered": "false", |
| + "USB powered": "true", |
| + "technology": "Li-ion", |
| + "present": "true" |
| + }, |
| + "wifi_ip": "", |
| + "imei_slice": "Unknown", |
| + "ro.build.id": "LRX21O", |
| + "ro.build.product": "product_name", |
| + "build_detail": |
| + "google/razor/flo:5.0/LRX21O/1570415:userdebug/dev-keys", |
| + "serial": "2222", |
| + "adb_status": "device", |
| + "blacklisted": False, |
| + "usb_status": True, |
| + }, |
| + { |
| + "adb_status": "offline", |
| + "blacklisted": True, |
| + "serial": "03e0363a003c6ad4", |
| + "usb_status": False, |
| + }, |
| + { |
| + "adb_status": "unauthorized", |
| + "blacklisted": True, |
| + "serial": "03e0363a003c6ad5", |
| + "usb_status": True, |
| + }, |
| + { |
| + "adb_status": "device", |
| + "blacklisted": True, |
| + "serial": "03e0363a003c6ad6", |
| + "usb_status": True, |
| + } |
| + ] |
| + |
| + # simulate the scenario when the first tested device works |
| + yield (api.test('local_basic_recipe_basic_device_' + buildername) + |
| + api.properties.tryserver( |
| + mastername='tryserver.chromium.perf', buildername=buildername) + |
| + api.properties( |
| + bisect_config=local_bisect_config) + api.properties( |
| + job_name='f7a7b4135624439cbd27fdd5133d74ec', |
| + buildnumber='8923hf89h3f8h29820j2d') + |
| + api.properties(parent_got_revision='1111111') + api.properties( |
| + parent_build_archive_url='gs://test-domain/test-archive.zip') + |
| + api.bisect_tester(tempfile='/tmp/dummy') + |
| + api.override_step_data('multiple_device_status', |
| + api.json.output(working_device)) + |
| + api.step_data('Resolving reference range.crrev get commit hash for ' + |
| + ('refs/heads/master@{#%s}' % local_bisect_config['bad_revision']), |
| + stdout=api.json.output( |
| + {'git_sha': bad_revision_hash}))+ |
| + api.step_data('Resolving reference range.crrev get commit hash for ' + |
| + ('refs/heads/master@{#%s}' % local_bisect_config[ |
| + 'good_revision']), |
| + stdout=api.json.output( |
| + {'git_sha': good_revision_hash}))+ |
| + api.step_data('Expanding revision range.for revisions %s:%s' % ( |
| + good_revision_hash, bad_revision_hash), |
| + stdout=api.json.output([[bad_revision_hash, 'ignored'], |
| + [good_revision_hash, 'ignored']])) + |
| + api.step_data('Post bisect results', |
| + stdout=api.json.output({'status_code': 200}))) |
| + |
| + # simulate the scenario when the no device is connected. |
| + yield (api.test('local_basic_recipe_no_device_' + buildername) + |
| + api.properties.tryserver( |
| + mastername='tryserver.chromium.perf', buildername=buildername) + |
| + api.properties( |
| + bisect_config=local_bisect_config) + api.properties( |
| + job_name='f7a7b4135624439cbd27fdd5133d74ec') + |
| + api.properties(parent_got_revision='1111111') + api.properties( |
| + parent_build_archive_url='gs://test-domain/test-archive.zip') + |
| + api.bisect_tester(tempfile='/tmp/dummy') + |
| + api.override_step_data('multiple_device_status', |
| + api.json.output([]))) |
| + |
| + # simulate the scenario when tests fail not because of device |
| + # disconnection. |
| + yield (api.test('local_basic_recipe_failed_device_' + buildername) + |
| + api.properties.tryserver( |
| + mastername='tryserver.chromium.perf', buildername=buildername) + |
| + api.properties( |
| + bisect_config=local_bisect_config) + api.properties( |
| + job_name='f7a7b4135624439cbd27fdd5133d74ec') + |
| + api.properties(parent_got_revision='1111111') + api.properties( |
| + parent_build_archive_url='gs://test-domain/test-archive.zip') + |
| + api.bisect_tester(tempfile='/tmp/dummy') + |
| + api.override_step_data('multiple_device_status', |
| + api.json.output(working_device)) + |
| + api.step_data('Resolving reference range.crrev get commit hash for ' + |
| + ('refs/heads/master@{#%s}' % local_bisect_config['bad_revision']), |
| + stdout=api.json.output( |
| + {'git_sha': bad_revision_hash}))+ |
| + api.step_data('Resolving reference range.crrev get commit hash for ' + |
| + ('refs/heads/master@{#%s}' % local_bisect_config[ |
| + 'good_revision']), |
| + stdout=api.json.output( |
| + {'git_sha': good_revision_hash}))+ |
| + api.step_data('Expanding revision range.for revisions %s:%s' % ( |
| + good_revision_hash, bad_revision_hash), |
| + stdout=api.json.output([[bad_revision_hash, 'ignored'], |
| + [good_revision_hash, 'ignored']])) + |
| + api.step_data('Post bisect results', retcode=1) + |
| + api.override_step_data('multiple_device_status (2)', |
| + api.json.output(working_device))) |
| + |
| + # simulate the scenario when tests fail because of device disconnection. |
| + yield (api.test('local_basic_recipe_disconnected_device_' + buildername) + |
| + api.properties.tryserver( |
| + mastername='tryserver.chromium.perf', buildername=buildername) + |
| + api.properties( |
| + bisect_config=local_bisect_config) + api.properties( |
| + job_name='f7a7b4135624439cbd27fdd5133d74ec') + |
| + api.properties(parent_got_revision='1111111') + api.properties( |
| + parent_build_archive_url='gs://test-domain/test-archive.zip') + |
| + api.bisect_tester(tempfile='/tmp/dummy') + |
| + api.override_step_data('multiple_device_status', |
| + api.json.output(bad_device)) + |
| + api.step_data('Resolving reference range.crrev get commit hash for ' + |
| + ('refs/heads/master@{#%s}' % local_bisect_config['bad_revision']), |
| + stdout=api.json.output( |
| + {'git_sha': bad_revision_hash}))+ |
| + api.step_data('Resolving reference range.crrev get commit hash for ' + |
| + ('refs/heads/master@{#%s}' % local_bisect_config[ |
| + 'good_revision']), |
| + stdout=api.json.output( |
| + {'git_sha': good_revision_hash}))+ |
| + api.step_data('Expanding revision range.for revisions %s:%s' % ( |
| + good_revision_hash, bad_revision_hash), |
| + stdout=api.json.output([[bad_revision_hash, 'ignored'], [ |
| + good_revision_hash, 'ignored']])) + |
| + api.step_data('Post bisect results', retcode=1) + |
|
RobertoCN
2016/07/14 23:46:03
# Simulating disconnect by raising failure and cha
|
| + api.override_step_data('multiple_device_status (2)', |
| + api.json.output(working_device)) + |
| + api.override_step_data('multiple_device_status (3)', |
| + api.json.output(working_device)) + |
| + api.step_data('Resolving reference range.crrev get commit hash for ' + |
| + ('refs/heads/master@{#%s} (2)' % local_bisect_config[ |
| + 'bad_revision']), |
| + stdout=api.json.output( |
| + {'git_sha': bad_revision_hash}))+ |
| + api.step_data('Resolving reference range.crrev get commit hash for ' + |
| + ('refs/heads/master@{#%s} (2)' % local_bisect_config[ |
| + 'good_revision']), |
| + stdout=api.json.output( |
| + {'git_sha': good_revision_hash}))+ |
| + api.step_data('Expanding revision range.for revisions %s:%s (2)' % ( |
| + good_revision_hash, bad_revision_hash), |
| + stdout=api.json.output([[bad_revision_hash, 'ignored'], [ |
| + good_revision_hash, 'ignored']])) + |
| + api.step_data('Post bisect results (2)', |
| + stdout=api.json.output({'status_code': 200}))) |