If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

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

RESOLVED FIXED in Firefox 40

Status

Testing
XPCShell Harness
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: markh, Assigned: markh)

Tracking

unspecified
mozilla40
Points:
---

Firefox Tracking Flags

(firefox40 fixed)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

3 years ago
Created attachment 8496637 [details] [diff] [review]
0001-Bug-XXXXXXX-add-requestCompleteLog-to-the-xpcshell-t.patch

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.
(Assignee)

Comment 3

3 years ago
Created attachment 8589387 [details] [diff] [review]
0001-Bug-1074014-allow-verbose-true-in-xpcshell-test-mani.patch

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+
(Assignee)

Updated

3 years ago
Summary: Add requestCompleteLog to xpcshell tests → Allow xpcshell tests to always dump verbose output when "verbose = true" is in the test manifest
(Assignee)

Comment 5

3 years ago
Created attachment 8590617 [details] [diff] [review]
0001-Bug-1074014-allow-verbose-true-in-xpcshell-test-mani.patch

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+
(Assignee)

Comment 7

3 years ago
https://hg.mozilla.org/integration/fx-team/rev/2c86fe79ec1c
https://hg.mozilla.org/mozilla-central/rev/2c86fe79ec1c
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox40: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.