Closed Bug 788279 Opened 12 years ago Closed 12 years ago

Allow moztest to take in duration and not use fake start&end times

Categories

(Testing :: Mozbase, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: mihneadb, Assigned: mihneadb)

References

Details

Not all harnesses provide start and end times so we need to be able to specify durations in the ctor for TestResult.
Assignee: nobody → mbalaur
I think more generally the issue is that the current API assumes it will be used realtime, so that results will be generated via something like:

t = TestResult(...)
# run test here
t.finish(...)

But, there are many cases where this will likely not be the case, and where we'll want to generate the results ex post facto.  In some of these cases, we won't know the actual start and finish times of the tests.  And in this situation, having to call finish() might not make much sense.

Is there any disadvantage to allowing all needed fields to be specified in the ctor, for cases where we're not populating results realtime?  Jeff, what's your opinion?
I guess my inclination is just setting time_start to 0 in these cases.  Its a bit wonky, but...

OTOH, if there was a duration argument for the ctor, I wouldn't be opposed, though it will require checks to make sure we're not passing in contradictory data.
I'm fine with using start_time=0; it will allow consumers some way to know that the start_time isn't real.
Blocks: 786848
I think the consensus is not to modify moztest for this; can we close as WONTFIX?
OK, will document the assumption and then close this.
https://github.com/mozilla/mozbase/commit/c772c5ab89c1b2078ceb1d5f6c65bb55b7af5031
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.