Open Bug 1087474 Opened 10 years ago Updated 2 years ago

Consolidate common code from Mochitest/Reftest into moztest

Categories

(Testing :: Mozbase, defect)

x86_64
Windows 7
defect

Tracking

(Not tracked)

People

(Reporter: ted, Unassigned)

References

Details

Once the Reftest structured logging work is done (bug 1034290) the Mochitest and Reftest harnesses are going to have a lot of duplicated code. We should consolidate that somewhere. ahal suggested moztest in bug 1025051. I'm not sure exactly what form this would look like, maybe a MozRunner subclass called 'TestRunner' or something like that?

I envision the shared functionality encompassing most of what Mochitest.OutputHandler does:
http://hg.mozilla.org/mozilla-central/annotate/ae4d9b4ff2ee/testing/mochitest/runtests.py#l1893
* fix stack
* record last run test

And some other things like:
* leak checking
* check for crashes
* timeout handling
What if instead of blocking on reftest structured logging, we extracted the common things now, so the structured logging patch would just point to the new definitions in mozbase? A lot of it could be shared immediately -- looking at runreftest.py 7bed20f7b776, we can't share lines 473 - 497 without landing structured logging, but we could share most of 365 - 471. A prototype-grade implementation of reftest structured logging would be good to do as a part of this to make sure the implementation isn't too far afield.

The advantage is that these functions don't have a chance to diverge in the meantime. The disadvantage is that this bug doesn't push on reftest structured logging to get landed. But we could probably find other ways to motivate our logging implementers.
I am fine with that as well, I just figured it might be easier to build the common implementation once you have more than one consumer to use it, otherwise we might wind up writing something that doesn't work for Reftest (also it might be clearer what bits are actually shared or not). I guess we can always refactor/rework as-needed so it's not that big of a deal.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.