Closed Bug 1041424 Opened 10 years ago Closed 10 years ago

[mozrunner] Improve exception when instantiating B2GDeviceRunner with no devices attached/detected

Categories

(Testing :: Mozbase, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla34

People

(Reporter: davehunt, Assigned: jgraham)

Details

Attachments

(1 file)

If ADB cannot detect any devices we should give a helpful message suggesting that none were found instead of the current IndexError: list index out of range:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/dhunt/workspace/mozilla/mozilla-central/testing/mozbase/mozrunner/mozrunner/base/device.py", line 69, in start
    self.device.connect()
  File "/Users/dhunt/workspace/mozilla/mozilla-central/testing/mozbase/mozrunner/mozrunner/devices/base.py", line 127, in connect
    serial = self.serial or self._get_online_devices()[0]
IndexError: list index out of range

To replicate:
from mozrunner import B2GDeviceRunner
B2GDeviceRunner().start()
Comment on attachment 8459561 [details] [diff] [review]
Raise a helpful exception if B2GDeviceRunner is used with no devices attached.

Review of attachment 8459561 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for fixing this!
Attachment #8459561 - Flags: review?(ahalberstadt) → review+
https://hg.mozilla.org/mozilla-central/rev/dc2a2ee82f10
Assignee: nobody → james
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: