Closed Bug 976354 Opened 12 years ago Closed 11 years ago

Figure out how to install Marionette as an extension

Categories

(Remote Protocol :: Marionette, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jgriffin, Assigned: mdas)

References

Details

For the b2g-cert-tests, we'll need to install Marionette as an extension, since we'll be running on production phones without Marionette built in. We'll need to figure out how to successfully package Marionette as an extension, which we can presumably install on a rooted B2G device using the same mechanism we do for mochitests (http://mxr.mozilla.org/mozilla-central/source/testing/mochitest/runtestsb2g.py#272)
Assignee: nobody → mdas
I forgot to update this, I have a working extension committed within https://github.com/andreastt/certtest/tree/master/device_setup. If you run push_marionette.sh against a production phone, it will set up the marionette@marionette.org bundle on the phone and you will be able to use it (though you'll need to forward the port). We will have to maintain one marionette@marionette.org bundle per version (1.3, 1.4, etc). I can set up an autogenerate script for that if we ever need to test a bundle against trunk. I have yet to hook it up to the main setup_environment.sh script. I'll do that when I get back from the day off.
I have to update marionette@marionette.org, it's using master right now, I'll have to update it to use 1.3
The Sprint 1 (Mar 17) deliverable here is: * A file inside https://etherpad.mozilla.org/fxos-cert-suite that contains a method that the meta-harness (bug 976360) can use to install Marionette on a device. ** Should reboot B2G after installation and verify Marionette is running. ** Shouldn't install Marionette if Marionette is already running when called. ** Should handle failure robustly with stack traces and helpful error messages.
Argh, this approach doesn't yet work, I made the mistake of testing against eng when I thought I was in prod. The commit in Comment#1 doesn't work yet.
This is now working! To respond to the sprint requirements: (In reply to Jonathan Griffin (:jgriffin) from comment #3) > The Sprint 1 (Mar 17) deliverable here is: > > * A file inside https://etherpad.mozilla.org/fxos-cert-suite that contains a > method that the meta-harness (bug 976360) can use to install Marionette on a > device. I have it committed to fxos-certsuite since that will be the metaharness location. Initial commit: https://github.com/mozilla-b2g/fxos-certsuite/commit/1bd371619b5bf6c707f32d8ca0a641ec1a6d7ca9 You can test it out with a production phone. First, ensure adb is running and then run https://github.com/mozilla-b2g/fxos-certsuite/blob/master/bundles/1.3/push_bundles.sh. I updated the script in a later commit to forward the adb port for you. > ** Should reboot B2G after installation and verify Marionette is running. push_bundles.sh does the b2g reboot and checks b2g, but doesn't verify if Marionette is running. I'd prefer if the metaharness who calls this would check, if it's safe to assume it's in python, since it can use the Marionette object to get a nice stack trace if anything fails when trying to get a session. > ** Shouldn't install Marionette if Marionette is already running when called. Should there be an option to allow this? If there are multiple 1.3 versions we're releasing, then if the user doesn't do a clean flash (maybe they just update gecko instead of a full update), then it's possible for the old Marionette extension to exist on the phone. We'll want to replace that with an updated one. > ** Should handle failure robustly with stack traces and helpful error > messages. push_bundles.sh doesn't generate any stack traces, it's just some shell code, but I've just updated it to print out a bunch of helpful error messages if it can't execute any of the lines. (https://github.com/mozilla-b2g/fxos-certsuite/commit/cf1e658576e28607d376040633023ad015202dd0)
That's great! I think ultimately we will want all the adb commands, etc, handled by Python in the meta-harness, so that we can handle errors better. You could either write a standalone Python file to do this, or wait until the skeleton of the meta-harness is in place, and add it. > > ** Should reboot B2G after installation and verify Marionette is running. > > push_bundles.sh does the b2g reboot and checks b2g, but doesn't verify if Marionette is running. Once the installation method is in Python, this will be easy to add. > > ** Shouldn't install Marionette if Marionette is already running when called. > > Should there be an option to allow this? If there are multiple 1.3 versions we're releasing, then if > the user doesn't do a clean flash (maybe they just update gecko instead of a full update), then it's > possible for the old Marionette extension to exist on the phone. We'll want to replace that with an > updated one. Good point. My thought was to avoid the time-consuming step of installing Marionette if it isn't needed, but it doesn't take that long and rebooting the device puts it into a known state anyway. > > ** Should handle failure robustly with stack traces and helpful error > > messages. > > push_bundles.sh doesn't generate any stack traces, it's just some shell code Yes, for this reason I think we need to handle it all within the Python framework.
marionette-extension installation code is now at https://github.com/mozilla-b2g/marionette-extension and available as the pypi package 'marionette_extension', which provides the install() function.
One thing this doesn't do is check if marionette is already installed. I'll close once that's resolved
(In reply to Malini Das [:mdas] from comment #8) > One thing this doesn't do is check if marionette is already installed. I'll > close once that's resolved Done in https://github.com/mozilla-b2g/marionette-extension/commit/7f85266a6df3140338c19666839ff03006eb73bc
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.