Moztest's unittest adapter should log stacks and messages separately

RESOLVED FIXED in mozilla34

Status

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: chmanchester, Assigned: chmanchester)

Tracking

unspecified
mozilla34
x86_64
Linux
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 2 obsolete attachments)

(Assignee)

Description

4 years ago
This will make formatting in a tbpl starrable way less brittle and make marionette's special formatter obsolete.
(Assignee)

Comment 1

4 years ago
Try (seeded failures): 

https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=71f776088afb

I think I'm ending up with too many newlines somewhere.
(Assignee)

Comment 2

4 years ago
Created attachment 8475458 [details] [diff] [review]
Include exception stacks in test_end actions in mozlog's formatters.

This makes the tbpl and mach formatters include stacks in test_end.
Attachment #8475458 - Flags: review?(james)
(Assignee)

Updated

4 years ago
Assignee: nobody → cmanchester
Status: NEW → ASSIGNED
(Assignee)

Comment 3

4 years ago
Created attachment 8475461 [details] [diff] [review]
Log a message and stack seperately in mozlog.

This modifies the unittest adapter to log messages and stack seperately. The traceback api is a little cryptic, but this seems to produce the expected output.
Attachment #8475461 - Flags: review?(james)
(Assignee)

Comment 4

4 years ago
Created attachment 8475463 [details] [diff] [review]
Remove marionette's ad hoc log formatter now that it's no longer needed.

Finally, this removes the one off formatter from marionette altogether.
Attachment #8475463 - Flags: review?(james)
Attachment #8475458 - Flags: review?(james) → review+
Attachment #8475461 - Flags: review?(james) → review+
Attachment #8475463 - Flags: review?(james) → review+
This looks good to me. I briefly looked at the output in treeherder and it seemed OK, but I assume you will post a corrected patch if you spot any problems I missed.
(Assignee)

Comment 6

4 years ago
Created attachment 8476188 [details] [diff] [review]
Log stacks and messages separately in moztest's unittest adapter and include stacks in mozlog's test_end.

This is the mozlog/moztest patches folded together, the marionette part is unchanged and might need to land after. Two details I noticed and fixed:

I was missing the "Traceback (most recent call last):" header we all know and love.
The idea of putting the message before the stacktrace is specific to the tbplformatter, the stack before the message gets us what I think we want in the machformatter.

The treeherder output looked mostly fine before, but here's a before/after for good measure:

Before: https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=8f25c9674672
After: https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=c175c76d9bee
Attachment #8476188 - Flags: review?(james)
(Assignee)

Updated

4 years ago
Attachment #8475461 - Attachment is obsolete: true
(Assignee)

Updated

4 years ago
Attachment #8475458 - Attachment is obsolete: true
Attachment #8476188 - Flags: review?(james) → review+
(Assignee)

Updated

4 years ago
Depends on: 1056930
(Assignee)

Updated

4 years ago
Keywords: leave-open
(Assignee)

Updated

4 years ago
Blocks: 1056977
https://hg.mozilla.org/mozilla-central/rev/eb09f73f2582
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.