Closed Bug 490955 Opened 15 years ago Closed 15 years ago

HTML mochitests should use packed.js instead of MochiKit.js

Categories

(Testing :: Mochitest, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dbaron, Assigned: dbaron)

References

(Blocks 1 open bug)

Details

(Keywords: perf)

Attachments

(2 files)

Right now the XHTML and XUL mochitest templates use packed.js, but the HTML mochitest template uses MochiKit.js.  Using packed.js makes tests load significantly faster.


To see how much faster, I did an experiment using the tests in content/canvas/test/.  I did six runs of these tests, alternating between MochiKit.js and packed.js, and got the results with "time
python ./runtests.py --test-path=content/canvas --autorun --close-when-done
>/dev/null 2>&1"

MochiKit.js: real 1m48.544s user 1m43.414s sys 0m2.136s
packed.js:   real 1m25.806s user 1m21.997s sys 0m1.680s
MochiKit.js: real 1m48.079s user 1m44.155s sys 0m2.304s
packed.js:   real 1m26.459s user 1m21.981s sys 0m1.892s
MochiKit.js: real 1m48.247s user 1m44.299s sys 0m2.148s
packed.js:   real 1m27.568s user 1m22.401s sys 0m2.044s


We should switch the template to use packed.js and switch all the tests as well.
Here's a patch to change the template.

Along with the review for this, I'd like you to give blanket review to change the tests as well.  (If 'perl -pi' behaves how I'd like through symbolic links, it should be trivial to generate a tree-wide patch; if not I'll have to resort to other tricks.)
Attachment #375288 - Flags: review?(sayrer)
Attachment #375288 - Flags: review?(sayrer) → review+
The following was useful (in objdir/_tests/testing/mochitest/tests):

find . -name "*.html" -printf "%l\n" | xargs -l50 perl -pi -e 's/MochiKit\/MochiKit.js/MochiKit\/packed.js/'
http://hg.mozilla.org/mozilla-central/rev/e517593a793f
http://hg.mozilla.org/mozilla-central/rev/8f7b73d88f6b

I had to remove the changes from the command in comment 2 for three files:

content/html/content/test/test_bug430351.html , which fails with them; I have no idea why

dom/tests/mochitest/ajax/mochikit/tests/MochiKit-MochiKit.html and dom/tests/mochitest/ajax/mochikit/tests/index.html , which wouldn't have been touched by a slightly narrower regex -- they're using ../MochiKit/ rather than /MochiKit/.


I should do another pass in a few weeks to pick up tests straggling in.
It actually doesn't seem to have helped very much.
Probably best to leave a few tests using MochiKit.js for the testing diversity, so actually just marking fixed.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Depends on: 357523
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: