Closed
Bug 680039
Opened 13 years ago
Closed 13 years ago
Add stack traces to soft assertion failures
Categories
(Mozilla QA Graveyard :: Mozmill Tests, defect)
Mozilla QA Graveyard
Mozmill Tests
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: davehunt, Assigned: whimboo)
References
Details
(Whiteboard: [lib])
Attachments
(2 files, 1 obsolete file)
1.68 KB,
patch
|
whimboo
:
review+
|
Details | Diff | Splinter Review |
6.87 KB,
patch
|
gmealer
:
review+
|
Details | Diff | Splinter Review |
Soft assertions (expects) don't currently have any stack traces when they fail.
Assignee | ||
Comment 1•13 years ago
|
||
This patch adds stack information to the soft assertion failures. I strip away unwanted properties from the stack, e.g. languageName, which we don't really need. The stack looks a bit different to the one we get with Error().stack. That's something we should investigate later.
Comment on attachment 554424 [details] [diff] [review] Patch v1 (API refactor) The code's fine. The algorithm is confusing, though. If you don't realize frame and stack are the same structure via copy-by-reference you wonder why all this modification is going on with frame, then stack is returned. Plus you do the same thing with frame on one side and stack on the other, when it's really keeping two stacks in sync. May help if you had an aFrame reference to aStack that you used inside the while so you're copying frame to frame instead of stack to frame. Comments could help too: var stack = { }; // new stack to be returned var frame = stack // frame being built in new stack, start at base. var aFrame = aStack; // frame being copied from old stack, start at base. while (aFrame) { frame.caller = null; frame.filename = aFrame.filename; ... // If there's more stack to process, create the next frame if (aFrame.caller) frame.caller = { }; // Go to the next frames in each stack aFrame = aFrame.caller; frame = frame.caller; } Even better, use oldFrame/newFrame/newStack instead of aFrame/frame/stack. stack vs. aStack doesn't have any meaning distinguishing them, same with frame vs. aFrame. r=me with it made a little clearer. Should be pretty quick, and no re-review required from me unless the change is more complex than above.
Attachment #554424 -
Flags: review?(gmealer) → review+
Assignee | ||
Comment 3•13 years ago
|
||
Thanks Geo. Yeah, sorry that I haven't really added some documentation beside the code. I now make use of better variable names. Taking over r+.
Attachment #554424 -
Attachment is obsolete: true
Attachment #555101 -
Flags: review+
Assignee | ||
Comment 4•13 years ago
|
||
Comment on attachment 555101 [details] [diff] [review] Patch v2 (API refactor) [checked-in] Landed as: https://github.com/geoelectric/mozmill-api-refactor/commit/68ce4a248d066d7b41a3c6a76744efc8a18f3461
Attachment #555101 -
Attachment description: Patch v2 → Patch v2 (API refactor) [checked-in]
Assignee | ||
Comment 5•13 years ago
|
||
Port to our current shared modules.
Attachment #555105 -
Flags: review?(gmealer)
Comment on attachment 555105 [details] [diff] [review] Patch v1 (Old API) I like the revised variable names--everything's much clearer. r+ for this patch, too.
Attachment #555105 -
Flags: review?(gmealer) → review+
Assignee | ||
Comment 7•13 years ago
|
||
Landed as: http://hg.mozilla.org/qa/mozmill-tests/rev/92a62ae4abb8 (default) http://hg.mozilla.org/qa/mozmill-tests/rev/d21eb87854e4 (aurora) http://hg.mozilla.org/qa/mozmill-tests/rev/cd784cbec430 (beta) http://hg.mozilla.org/qa/mozmill-tests/rev/87622da0810d (release)
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•12 years ago
|
Component: Mozmill Shared Modules → Mozmill Tests
Assignee | ||
Updated•12 years ago
|
Whiteboard: [lib]
Updated•5 years ago
|
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•