Closed Bug 988382 Opened 11 years ago Closed 11 years ago

mozrunner.remote.B2GRunner changes needed to support web-platform-tests

Categories

(Testing :: Mozbase, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla31

People

(Reporter: jgraham, Assigned: jgraham)

References

Details

Attachments

(1 file, 1 obsolete file)

Web-platform-tests has some different requirements compared to mochitest, so a small refactor of the runner to make fewer assumptions was required.
Comment on attachment 8397994 [details] [diff] [review] Allow mozrunner.remote.B2GRunner to start without connecting to Marionette. I haven't got this to fail locally but it seemed pretty busted on try [1], so any idea what I'm missing would be helpful. [1] https://tbpl.mozilla.org/?tree=Try&rev=356bed415f45
Attachment #8397994 - Flags: feedback?(ahalberstadt)
Comment on attachment 8397994 [details] [diff] [review] Allow mozrunner.remote.B2GRunner to start without connecting to Marionette. Review of attachment 8397994 [details] [diff] [review]: ----------------------------------------------------------------- I don't really understand why you can't connect to marionette? Is it just because you don't need to? If that's the case then could we create the emulator object in B2GRunner instead of receiving it as an argument? I think that orange might be a known intermittent. I re-triggered a couple times to verify. ::: testing/mozbase/mozrunner/mozrunner/remote.py @@ +125,2 @@ > self.marionette = marionette > + if marionette_port is None and self.marionette is not None: nit: 'self.marionette is not None' is a double negative, just use 'if self.marionette:'. Same for the conditionals below.
Attachment #8397994 - Flags: feedback?(ahalberstadt) → feedback+
(In reply to Andrew Halberstadt [:ahal] from comment #3) > Comment on attachment 8397994 [details] [diff] [review] > Allow mozrunner.remote.B2GRunner to start without connecting to Marionette. > > Review of attachment 8397994 [details] [diff] [review]: > ----------------------------------------------------------------- > > I don't really understand why you can't connect to marionette? Is it just > because you don't need to? If that's the case then could we create the > emulator object in B2GRunner instead of receiving it as an argument? So I don't have an emulator object at the moment; I've concentrated on running on a real device since that's what the certtest needs. The reason I can't connect to marionette here is that the architecture of web-platform-tests splits what Mochitest does as a single step into two seperate concerns represented by two objects; a "Browser" object that is just responsible for launching the browser with the right settings and an Executor object that is actually responsible for managing the marionette connection and running the tests. The way that parallelisation work in the harness, these objects actually live in separate processes. It's the Browser object that owns the Runner instance so the Runner can't take responsibility for connecting to marionette. > I think that orange might be a known intermittent. I re-triggered a couple > times to verify. It looks like it's broken :( > ::: testing/mozbase/mozrunner/mozrunner/remote.py > @@ +125,2 @@ > > self.marionette = marionette > > + if marionette_port is None and self.marionette is not None: > > nit: 'self.marionette is not None' is a double negative, just use 'if > self.marionette:'. Same for the conditionals below. I don't really understand. Why is it preferable to do the implicit type conversion rather than comparing to the specific sentinal value that indicates no object was passed in?
Comment on attachment 8398564 [details] [diff] [review] Allow B2GRunner to be created without starting a marionette session Try run is in progress [1], so obviously that also needs to pass. [1] https://tbpl.mozilla.org/?tree=Try&rev=187378bff329
Attachment #8398564 - Flags: review?(ahalberstadt)
Attachment #8397994 - Attachment is obsolete: true
Try run was green :)
Comment on attachment 8398564 [details] [diff] [review] Allow B2GRunner to be created without starting a marionette session Review of attachment 8398564 [details] [diff] [review]: ----------------------------------------------------------------- ::: testing/mozbase/mozrunner/mozrunner/remote.py @@ +161,5 @@ > self._setup_remote_profile() > # reboot device so it starts up with the proper profile > + if not self.emulator: > + t0 = time.time() > + self.dm.reboot(wait=True) Please remove _reboot_device. Almost positive nothing else is using it. @@ +177,5 @@ > self.process_handler.run(timeout=timeout, outputTimeout=outputTimeout) > > # Set up port forwarding again for Marionette, since any that > # existed previously got wiped out by the reboot. > + if not self.emulator: If we're going to use is None/is not None above, we might as well be consistent :). To answer your question, I find this way more readable, but apparently using is not None is part of PEP 8, so I concede. Please also update below.
Attachment #8398564 - Flags: review?(ahalberstadt) → review+
Assignee: nobody → james
Status: NEW → ASSIGNED
OS: Linux → All
Hardware: x86_64 → All
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: