Closed Bug 1492239 Opened 6 years ago Closed 6 years ago

Use AndroidMixin from android_emulator_unittest

Categories

(Testing :: General, enhancement, P1)

Version 3
enhancement

Tracking

(firefox64 fixed)

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: gbrown, Assigned: gbrown)

References

Details

Attachments

(1 file)

AndroidMixin was added to support android in the raptor mozharness script. It can be used from android_emulator_unittest.py also, eliminating some duplicate code.
Assignee: nobody → gbrown
Blocks: 1492240
Priority: -- → P1
Comment on attachment 9011147 [details] [diff] [review]
use AndroidMixin in android_emulator_unittest

Obviously my main concern here was eliminating code duplication, using AndroidMixin where possible, especially for any device interaction. The patch is complicated by a few distractions (sorry!):
 - s/emulator/device/ in some places and moving some code blocks, to make it easier to diff android_emulator_unittest.py vs android_hardware_unittest.py
 - simplification of the emulator configuration since the "emulator.name" was not really useful
 - making the minimum bogomips check configurable

I have eliminated some explicit adb operations, particularly the adbd restart in favor of relying on normal mozdevice operation. I don't see any difference in reliability in try runs -- hopefully this change is safe.

It is possible to eliminate more similar/duplicated code, or perhaps even consider combining scripts into one android_unittest.py, but this seemed like a good start. Would like to hear what you think about additional efforts here.
Attachment #9011147 - Flags: review?(bob)
Comment on attachment 9011147 [details] [diff] [review]
use AndroidMixin in android_emulator_unittest

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

Looks great. r+

::: testing/mozharness/scripts/android_emulator_unittest.py
@@ +296,4 @@
>      def _verify_emulator_and_restart_on_fail(self):
>          emulator_ok = self._verify_emulator()
>          if not emulator_ok:
> +            self.screenshot("emulator-startup-screenshot-")

Please file a follow up bug to use mozscreenshot's dump_screen/dump_device_screen so we can support hardware screenshots as well.
Attachment #9011147 - Flags: review?(bob) → review+
See Also: → 1494437
(In reply to Bob Clary [:bc:] from comment #3)
> Please file a follow up bug to use mozscreenshot's
> dump_screen/dump_device_screen so we can support hardware screenshots as
> well.

Thanks - bug 1494437.
Pushed by gbrown@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/5b80e87d28c3
Use AndroidMixin for android_emulator_unittest; r=bc
https://hg.mozilla.org/mozilla-central/rev/5b80e87d28c3
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: