Closed
Bug 902711
Opened 12 years ago
Closed 11 years ago
Split the monolithic marionette Python package
Categories
(Remote Protocol :: Marionette, defect)
Remote Protocol
Marionette
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla31
People
(Reporter: jgriffin, Assigned: jgriffin)
References
Details
(Keywords: pi-marionette-task, Whiteboard: [u=marionette-user c=marionette-python p=2])
Attachments
(1 file, 4 obsolete files)
15.69 KB,
patch
|
ato
:
review+
|
Details | Diff | Splinter Review |
We want to split the monolithic Marionette Python package into some components:
marionette_transport: what's currently contained in client.py, mostly
marionette_api or marionette_protocol: the pure API parts of marionette.py, errors.py, and related files
marionette_runner: the runner, plus the parts of the current Marionette class which have nothing to do with the API
I'm not the best at naming things, so if you have suggestions for names, let me know.
Comment 1•12 years ago
|
||
This is awesome! (and very similar to what we do in the node js client)
Comment 2•12 years ago
|
||
(In reply to Jonathan Griffin (:jgriffin) from comment #0)
> marionette_api or marionette_protocol: the pure API parts of marionette.py,
> errors.py, and related files
I think we should continue to call this marionette_client, both for backwards compatibility purposes as well as the fact that I think this name more intuitively describes what this package will provide (a client you can use to interact with something providing a marionette server).
Assignee | ||
Comment 3•12 years ago
|
||
For backwards compatibility, we'd actually want to call marionette_runner marionette_client, as that is what existing consumers expect when they import marionette_client.
Comment 4•12 years ago
|
||
(In reply to Jonathan Griffin (:jgriffin) from comment #3)
> For backwards compatibility, we'd actually want to call marionette_runner
> marionette_client, as that is what existing consumers expect when they
> import marionette_client.
Hmm, I guess it would depend on the consumer now that I think about it. Ok, so I guess backwards compatibility is not an argument though my comment about intuitive naming schemes still stands. :)
Assignee | ||
Updated•11 years ago
|
Whiteboard: [u=marionette-user c=marionette-python p=2]
Assignee | ||
Comment 5•11 years ago
|
||
We're probably going to need a mozbase-style setup_development.py, in order to allow local installations to use the latest versions of all the marionette modules, rather than pulling potentially stale packages from pypi.
Assignee | ||
Comment 6•11 years ago
|
||
WIP - separates out the transport layer into a separate class. Will separate out the api next.
Comment 7•11 years ago
|
||
Comment on attachment 816890 [details] [diff] [review]
WIP
quick scan this looks good!
Comment 8•11 years ago
|
||
Comment on attachment 816890 [details] [diff] [review]
WIP
Review of attachment 816890 [details] [diff] [review]:
-----------------------------------------------------------------
happy to see a WIP for this
::: testing/marionette/marionette_transport/marionette_transport/transport.py
@@ +5,5 @@
> +import json
> +import socket
> +
> +
> +class MarionetteClient(object):
Can this be renamed to MarionetteTransport?
Assignee | ||
Comment 9•11 years ago
|
||
(In reply to Malini Das [:mdas] from comment #8)
> Comment on attachment 816890 [details] [diff] [review]
> WIP
>
> Review of attachment 816890 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> happy to see a WIP for this
>
> ::: testing/marionette/marionette_transport/marionette_transport/transport.py
> @@ +5,5 @@
> > +import json
> > +import socket
> > +
> > +
> > +class MarionetteClient(object):
>
> Can this be renamed to MarionetteTransport?
Done, for the next iteration!
Assignee | ||
Comment 10•11 years ago
|
||
I've started moving the marionette api into it's own package; this patch is an incomplete but partially functional WIP. We can sort out the names of the packages once we have a final patch, IMO.
Assignee | ||
Updated•11 years ago
|
Attachment #816890 -
Attachment is obsolete: true
Assignee | ||
Comment 11•11 years ago
|
||
This does some moderately crazy stuff with setup.py in an attempt to provide a good developer experience and maintain compatbility with CI. I'll run this all through try.
Attachment #8382556 -
Flags: review?(ato)
Assignee | ||
Updated•11 years ago
|
Attachment #817558 -
Attachment is obsolete: true
Assignee | ||
Comment 12•11 years ago
|
||
Comment on attachment 8382556 [details] [diff] [review]
Split the transport into a separate package,
This changes our error handling a bit in the transport to be more consistent; the transport now throws IOError on failure to send/or receive, whereas before we threw InvalidResponseException when receiving a null response, vs an IOError when failing to send. I'll have to check gaiatest to make sure this doesn't break anything downstream.
Attachment #8382556 -
Flags: feedback?(mdas)
Assignee | ||
Comment 13•11 years ago
|
||
Comment 14•11 years ago
|
||
Comment on attachment 8382556 [details] [diff] [review]
Split the transport into a separate package,
Review of attachment 8382556 [details] [diff] [review]:
-----------------------------------------------------------------
crazy code makes sense for our crazy case. f+!
::: testing/marionette/client/requirements.txt
@@ +1,1 @@
> +../marionette_transport
why the ../?
Attachment #8382556 -
Flags: feedback?(mdas) → feedback+
Assignee | ||
Comment 15•11 years ago
|
||
(In reply to Malini Das [:mdas] from comment #14)
>
> ::: testing/marionette/client/requirements.txt
> @@ +1,1 @@
> > +../marionette_transport
>
> why the ../?
It's a relative path; it's in testing/marionette/marionette_transport. Since it's a self-contained package, I don't think it makes sense to have it in a descendant directory.
Comment 16•11 years ago
|
||
ah, right
Assignee | ||
Comment 17•11 years ago
|
||
The only change needed in gaiatest, AFAIK, is https://github.com/mozilla-b2g/gaia/blob/master/tests/python/gaia-ui-tests/gaiatest/gaia_test.py#L858
Assignee | ||
Comment 18•11 years ago
|
||
15:29:26 INFO - Could not find any downloads that satisfy the requirement marionette-transport==0.1 (from marionette-client->-r /builds/slave/test/build/tests/config/marionette_requirements.txt (line 2))
15:29:26 INFO - No distributions at all found for marionette-transport==0.1 (from marionette-client->-r /builds/slave/test/build/tests/config/marionette_requirements.txt (line 2))
I need to make sure the new package ends up in tests.zip.
Assignee | ||
Comment 19•11 years ago
|
||
Fixed the packaging problem.
Attachment #8382658 -
Flags: review?(ato)
Assignee | ||
Updated•11 years ago
|
Attachment #8382556 -
Attachment is obsolete: true
Attachment #8382556 -
Flags: review?(ato)
Assignee | ||
Comment 20•11 years ago
|
||
New desktop try run: https://tbpl.mozilla.org/?tree=Try&rev=d491a0ef95a4
Assignee | ||
Comment 21•11 years ago
|
||
desktop try green, here's a B2G try run: https://tbpl.mozilla.org/?tree=Try&rev=11ffc70470d5
Comment 22•11 years ago
|
||
Comment on attachment 8382658 [details] [diff] [review]
Split the transport into a separate package,
Review of attachment 8382658 [details] [diff] [review]:
-----------------------------------------------------------------
Overall I think this patch looks fine, but I have two concerns
which might might be nitpicks:
* PyPI prefers using dashes to separate words in package names.
So whilst "marionette_transport" follows "marionette_client",
do we want to prefer "marionette-transport"?
* The directory structure for the new marionette_transport
module will be testing/marionette/marionette_transport/marionette_transport
which seems a little excessive. Could we potentially shorten
it to testing/marionette/transport/marionette_transport? Do
you have a strong opinion on this?
::: testing/marionette/client/marionette/b2g_update_test.py
@@ +24,5 @@
> SEND_TIMEOUT = 60 * 5
> MAX_RETRIES = 24
>
> def __init__(self, addr, port, runner):
> + MarionetteTransport.__init__(self, addr, port)
Since MarionetteTransport is a new style class, we should probably prefer to initialize it using the new style super class built-in:
super(B2GUpdateMarionetteClient, self).__init__(self, addr, port)
Updated•11 years ago
|
Flags: needinfo?(jgriffin)
Assignee | ||
Comment 23•11 years ago
|
||
Addressed review comments. Desktop try run: https://tbpl.mozilla.org/?tree=Try&rev=7c27bb892a80
Assignee | ||
Updated•11 years ago
|
Attachment #8382658 -
Attachment is obsolete: true
Attachment #8382658 -
Flags: review?(ato)
Comment 24•11 years ago
|
||
Comment on attachment 8397457 [details] [diff] [review]
Split the transport into a separate package,
Review of attachment 8397457 [details] [diff] [review]:
-----------------------------------------------------------------
lgtm
Attachment #8397457 -
Flags: review+
Updated•11 years ago
|
Flags: needinfo?(jgriffin)
Assignee | ||
Comment 25•11 years ago
|
||
Desktop try is green, here's one for B2G: https://tbpl.mozilla.org/?tree=Try&rev=05f5af1b4276
Assignee | ||
Comment 28•11 years ago
|
||
(In reply to Jonathan Griffin (:jgriffin) from comment #25)
> Desktop try is green, here's one for B2G:
> https://tbpl.mozilla.org/?tree=Try&rev=05f5af1b4276
sigh, packaging problems, let's try again: https://tbpl.mozilla.org/?tree=Try&rev=faca98d53467
Assignee | ||
Comment 29•11 years ago
|
||
Once more, with feeling: https://tbpl.mozilla.org/?tree=Try&rev=4f7ab401db41
Assignee | ||
Comment 30•11 years ago
|
||
Assignee | ||
Comment 31•11 years ago
|
||
Comment 32•11 years ago
|
||
Would it make sense to have to PyPi docs explicitly mention that the raw handles should be sharable with WebDriver so that one can do automated testing of content using a familiar API but still have the option of reaching up into Firefox chrome if necessary?
Assignee | ||
Comment 33•11 years ago
|
||
I believe the plan is to eventually add a plugin of some sort to the WebDriver Python bindings that would allow it to use the Marionette transport, but that work hasn't been done yet.
Comment 34•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 35•11 years ago
|
||
FYI, we can tackle splitting out other pieces of the marionette client in separate bugs.
Comment 36•11 years ago
|
||
(In reply to Dan Mosedale (:dmose) from comment #32)
> Would it make sense to have to PyPi docs explicitly mention that the raw
> handles should be sharable with WebDriver so that one can do automated
> testing of content using a familiar API but still have the option of
> reaching up into Firefox chrome if necessary?
So the WebDriver protocol explicitly caters for this sort of eventuality
by allowing driver implementations to provide vendor prefixed command
end-points specific to a certain browser.
How we expose that in the client API bindings is a good question, but as
jgriffin points out, an extension/mixin of sorts would make a lot of sense.
Depends on: 996477
Just run marionette-webapi tests and we got Bug 996477 now.
Updated•11 years ago
|
Comment 38•11 years ago
|
||
(In reply to Andreas Tolfsen (:ato) from comment #36)
> (In reply to Dan Mosedale (:dmose) from comment #32)
> > Would it make sense to have to PyPi docs explicitly mention that the raw
> > handles should be sharable with WebDriver so that one can do automated
> > testing of content using a familiar API but still have the option of
> > reaching up into Firefox chrome if necessary?
>
> So the WebDriver protocol explicitly caters for this sort of eventuality
> by allowing driver implementations to provide vendor prefixed command
> end-points specific to a certain browser.
>
> How we expose that in the client API bindings is a good question, but as
> jgriffin points out, an extension/mixin of sorts would make a lot of sense.
My expectation is that the Loop project is likely to want this before long. Is there already a bug on file?
Updated•2 years ago
|
Product: Testing → Remote Protocol
You need to log in
before you can comment on or make changes to this bug.
Description
•