Closed Bug 882461 Opened 11 years ago Closed 11 years ago

add all of mozbase directories to sys.path instead of really reinventing importing

Categories

(Testing :: Mozbase, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla24

People

(Reporter: k0scist, Assigned: ahal)

References

Details

Attachments

(1 file, 1 obsolete file)

See:
* https://bugzilla.mozilla.org/show_bug.cgi?id=849900
* https://bugzilla.mozilla.org/show_bug.cgi?id=877733#c40
* https://bugzilla.mozilla.org/show_bug.cgi?id=707976

Both runxpcshell.py and automation.py.in have some, ahem,
"interesting" magical import logic:
* http://mxr.mozilla.org/mozilla-central/source/build/automation.py.in#27
* http://mxr.mozilla.org/mozilla-central/source/testing/xpcshell/runxpcshelltests.py#25

And, of course, let us not forget our mozinfo importing hack:
* http://mxr.mozilla.org/mozilla-central/source/testing/xpcshell/Makefile.in
* ...and others?

Until bug 849900 can actually be fixed, we should replace this with
something that adds all the mozbase modules to the sys.path, like :ted
suggests in https://bugzilla.mozilla.org/show_bug.cgi?id=877733#c40 :

for d in os.listdir(mozbase):
    sys.path.append(os.path.join(mozbase, d))
Blocks: 877733
Did a quick try push for windows:
https://tbpl.mozilla.org/?tree=Try&rev=67da8ec26bba
Assignee: nobody → ahalberstadt
Status: NEW → ASSIGNED
Attachment #762153 - Flags: review?(jhammel)
Attachment #762153 - Attachment is patch: true
Attachment #762153 - Attachment mime type: message/rfc822 → text/plain
https://tbpl.mozilla.org/?tree=Try&rev=ec3b4019624f

Might help to actually import the modules afterwards...
Attachment #762153 - Attachment is obsolete: true
Attachment #762153 - Flags: review?(jhammel)
Hmm, trychooser told me that syntax would run tests on win7.. but apparently not:
https://tbpl.mozilla.org/?tree=Try&rev=dfe3b9d8de18
Attachment #762275 - Flags: review?(jhammel)
Comment on attachment 762275 [details] [diff] [review]
Patch 2.0 - actually import modules this time

lgtm;  because this touches the infamous automation.py.in, a full try run may be prudent.  Also, the mozinfo magic for xpcshell should be cleaned from the makefile, but that can be taken as a follow-up
Attachment #762275 - Flags: review?(jhammel) → review+
pushed to try, full run: https://tbpl.mozilla.org/?tree=Try&rev=89bd79ae8344 ; perhaps overkill but there ya go.

Any objections to pushing this to m-c if this works?
On android 2.2 opt: 

TEST-UNEXPECTED-FAIL | xpccheck | test test_bug608142.js is missing from test manifest /builds/slave/try-and-0000000000000000000000/build/js/xpconnect/tests/unit/xpcshell.ini!
make[6]: *** [libs-xpcshell-tests] Error 1
make[5]: *** [tools] Error 2
make[4]: *** [tools_tier_platform] Error 2
make[3]: *** [tier_platform] Error 2
make[2]: *** [default] Error 2
make[1]: *** [realbuild] Error 2
make: *** [build] Error 2

I didn't read all of https://bugzilla.mozilla.org/show_bug.cgi?id=608142 and am not sure if this is a real problem (seems unrelated to the patch, anyway). Another try run is going on https://bugzilla.mozilla.org/show_bug.cgi?id=877733 so if this recurs, then we can decide what to do (again, repeat, not related to this patch).

Again, I'll land this soon sans objections
FYI that's bug 883918, I think it's just an infra problem.
pushed to inbound: https://hg.mozilla.org/integration/mozilla-inbound/rev/bb0567fbb4cc

subsequent bug should be filed for Makefile.in cleanup
Blocks: 884181
(In reply to Jeff Hammel [:jhammel] from comment #8)
<snip/>
> subsequent bug should be filed for Makefile.in cleanup

bug 884181
https://hg.mozilla.org/mozilla-central/rev/bb0567fbb4cc
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: