Closed Bug 1074014 Opened 5 years ago Closed 5 years ago

Allow xpcshell tests to always dump verbose output when "verbose = true" is in the test manifest

Categories

(Testing :: XPCShell Harness, defect)

defect
Not set

Tracking

(firefox40 fixed)

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: markh, Assigned: markh)

Details

Attachments

(1 file, 2 obsolete files)

Mochitests have a [SimpleTest.]requestCompleteLog function available so that a test can request the complete log to be included even when the test succeeds.  This would help, eg, bug 1073639, where the test succeeds on every platform but takes 1 second on some and *minutes* on others.

The following patch takes a bit of a low-road - when the function requestCompleteLog is called it logs an action with "request_complete_log", which the parent notices and simply flips the "verbose" flag to true.
Attachment #8496637 - Flags: review?(ted)
Comment on attachment 8496637 [details] [diff] [review]
0001-Bug-XXXXXXX-add-requestCompleteLog-to-the-xpcshell-t.patch

Review of attachment 8496637 [details] [diff] [review]:
-----------------------------------------------------------------

I think this would be better implemented as a manifest key. The Mochitest solution is like it is for other reasons. How about just:
[test_foo.js]
verbose = true

or
[test_foo.js]
complete_log = true
Attachment #8496637 - Flags: review?(ted)
Fyi to get all test output you can add --verbose here (or config equivalent to the platform you care about):
http://dxr.mozilla.org/mozilla-central/source/testing/config/mozharness/b2g_emulator_config.py#45

This isn't the same as requestCompleteLog, but might be an acceptable workaround in the meantime.
Sorry for the massive context switch, but I'm back chasing an orange for which this would be extremely useful.

This patch allows xpcshell.ini to |verbose=true| in a section which causes all output for the test to be dumped even when the test succeeds.

Is this what you had in mind?
Attachment #8496637 - Attachment is obsolete: true
Attachment #8589387 - Flags: feedback?(ted)
Comment on attachment 8589387 [details] [diff] [review]
0001-Bug-1074014-allow-verbose-true-in-xpcshell-test-mani.patch

Review of attachment 8589387 [details] [diff] [review]:
-----------------------------------------------------------------

Yeah, that looks good! For bonus points you could add a test for this to selftest.py:
https://dxr.mozilla.org/mozilla-central/source/testing/xpcshell/selftest.py
Attachment #8589387 - Flags: feedback?(ted) → feedback+
Summary: Add requestCompleteLog to xpcshell tests → Allow xpcshell tests to always dump verbose output when "verbose = true" is in the test manifest
Same patch but with tests.
Assignee: nobody → mhammond
Attachment #8589387 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #8590617 - Flags: review?(ted)
Comment on attachment 8590617 [details] [diff] [review]
0001-Bug-1074014-allow-verbose-true-in-xpcshell-test-mani.patch

Review of attachment 8590617 [details] [diff] [review]:
-----------------------------------------------------------------

Very thorough! :)
Attachment #8590617 - Flags: review?(ted) → review+
https://hg.mozilla.org/mozilla-central/rev/2c86fe79ec1c
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.