Closed Bug 983821 Opened 8 years ago Closed 7 years ago

'marionette' cli entrypoint doesn't have access to proper packages


(Testing :: Marionette, defect)

Not set


(firefox42 fixed)

Tracking Status
firefox42 --- fixed


(Reporter: mdas, Assigned: parkouss)


(Keywords: pi-marionette-runner, Whiteboard: [runner])


(1 file)

if you install the marionette client package and do

marionette --address=localhost:2828 tests/unit/

in <mozilla-central>/testing/marionette/client/marionette/ , then you'll get a stacktrace with:

    from marionette_test import MarionetteTestCase
ImportError: No module named marionette_test

so something's wrong in our packaging/entrypoint.
Whiteboard: [runner]
I can not reproduce this issue, either by installing from pypi or directly from the tree.

I tried:

pip install marionette_client
pip install -e . (in TREE/testing/marionette/client)

each time in a fresh virtualenv, with the command "marionette tests/unit/ --binary `which firefox`" and this run fine.

But I saw that there are some import in client that are not "absolute" - ie, there is "from marionette_test".

I think that these imports inside the package should be replaced by either "from marionette.marionette_test", or "from .marionette_test" to avoid possible module name conflict.

:mdas, does that sound like fixing this bug if I do these changes ?
Flags: needinfo?(malini)
Whoa, bugmail! Haven't had this in a while :)

I'm now working for a closed source company, and unfortunately, I don't have clearance to work on Marionette yet, so I can't really help out.

I think dburns should be able to advise here.
Flags: needinfo?(malini) → needinfo?(dburns)
yea, doing that will be fixing this bug. Thanks!
Flags: needinfo?(dburns)
Bug 983821 - 'marionette' cli entrypoint doesn't have access to proper packages. r?dburns
Attachment #8631142 - Flags: review?(dburns)
Assignee: nobody → j.parkouss
Comment on attachment 8631142 [details]
MozReview Request: Bug 983821 - 'marionette' cli entrypoint doesn't have access to proper packages. r?dburns

Ship It!
Attachment #8631142 - Flags: review?(dburns) → review+
Hmm, all red, because of "Attempted relative import in non-package". This is because test harnesses uses the script (inside the marionette_client package), hence this pass locally because I used the "marionette" executable entry point installed inside the virtualenv.

Usually, I find that it is not a good habit to call some scripts inside a package directy from the interpreter, because of these kind of errors, and also because it is then possible to have this executed file imported twice, which is then a lot confusing.

Anyway I fixed the relative imports inside to be absolute (using marionette instead of .) - I think that's ok for you David. This should do the trick, and another bug could be raised in case you want to get rid of the call made by the harnesses.

new push to try:
Yeah, all green this time. David, is the new patch ok for you, and could I land that ?
Flags: needinfo?(dburns)
land it!
Flags: needinfo?(dburns)
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in before you can comment on or make changes to this bug.