Commit 545a9ceb authored by perezju's avatar perezju Committed by Commit bot

Remove implicit config options from provision_devices

Build bot recipes have been upgraded to explicitly request the provisioning
options they need.

At this point it should be safe to remove the code that guessed the required
configuration from the bot name.

BUG=450984

Review URL: https://codereview.chromium.org/926333004

Cr-Commit-Position: refs/heads/master@{#317034}
parent 1d7c9bcb
...@@ -178,7 +178,7 @@ def ProvisionDevice(device, options): ...@@ -178,7 +178,7 @@ def ProvisionDevice(device, options):
if options.disable_network: if options.disable_network:
device_settings.ConfigureContentSettings( device_settings.ConfigureContentSettings(
device, device_settings.NETWORK_DISABLED_SETTINGS) device, device_settings.NETWORK_DISABLED_SETTINGS)
if options.wait_for_battery: if options.min_battery_level is not None:
try: try:
battery_info = device.old_interface.GetBatteryInfo() battery_info = device.old_interface.GetBatteryInfo()
except Exception as e: except Exception as e:
...@@ -241,24 +241,11 @@ def main(): ...@@ -241,24 +241,11 @@ def main():
logging.getLogger().addHandler(custom_handler) logging.getLogger().addHandler(custom_handler)
logging.getLogger().setLevel(logging.INFO) logging.getLogger().setLevel(logging.INFO)
# TODO(perezju): This script used to rely on the builder name to determine
# the desired device configuration for perf bots. To safely phase this out,
# we now:
# - expose these configuration settings as command line options
# - set default values for these options based on the builder name, thus
# matching the previous behaviour of the script on all bots.
# - explicitly adding these options on the perf bots will also maintain the
# script behaviour, namely:
# --wait-for-battery --disable-network --disable-java-debug
# - after all perf-bot recipes are updated, we can remove the following
# builder-name-sniffing code and replace |is_perf| with |False|.
is_perf = 'perf' in os.environ.get('BUILDBOT_BUILDERNAME', '').lower()
# Recommended options on perf bots: # Recommended options on perf bots:
# --disable-network # --disable-network
# TODO(tonyg): We eventually want network on. However, currently radios # TODO(tonyg): We eventually want network on. However, currently radios
# can cause perfbots to drain faster than they charge. # can cause perfbots to drain faster than they charge.
# --wait-for-battery # --min-battery-level 95
# Some perf bots run benchmarks with USB charging disabled which leads # Some perf bots run benchmarks with USB charging disabled which leads
# to gradual draining of the battery. We must wait for a full charge # to gradual draining of the battery. We must wait for a full charge
# before starting a run in order to keep the devices online. # before starting a run in order to keep the devices online.
...@@ -274,20 +261,15 @@ def main(): ...@@ -274,20 +261,15 @@ def main():
help='when wiping the device, max number of seconds to' help='when wiping the device, max number of seconds to'
' wait after each reboot ' ' wait after each reboot '
'(default: %s)' % _DEFAULT_TIMEOUTS.HELP_TEXT) '(default: %s)' % _DEFAULT_TIMEOUTS.HELP_TEXT)
parser.add_argument('--wait-for-battery', action='store_true', parser.add_argument('--min-battery-level', type=int, metavar='NUM',
default=is_perf, help='wait for the device to reach this minimum battery'
help='wait for the battery on the devices to charge') ' level before trying to continue')
parser.add_argument('--min-battery-level', default=95, type=int,
metavar='NUM',
help='when waiting for battery, minimum battery level'
' required to continue (default: %(default)s)')
parser.add_argument('--disable-location', action='store_true', parser.add_argument('--disable-location', action='store_true',
help='disable Google location services on devices') help='disable Google location services on devices')
parser.add_argument('--disable-network', action='store_true', parser.add_argument('--disable-network', action='store_true',
default=is_perf,
help='disable network access on devices') help='disable network access on devices')
parser.add_argument('--disable-java-debug', action='store_false', parser.add_argument('--disable-java-debug', action='store_false',
dest='enable_java_debug', default=not is_perf, dest='enable_java_debug', default=True,
help='disable Java property asserts and JNI checking') help='disable Java property asserts and JNI checking')
parser.add_argument('-t', '--target', default='Debug', parser.add_argument('-t', '--target', default='Debug',
help='the build target (default: %(default)s)') help='the build target (default: %(default)s)')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment