Closed Bug 787116 Opened 13 years ago Closed 13 years ago

Marionette's printLogs should write to stderr instead of stdout

Categories

(Remote Protocol :: Marionette, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla18

People

(Reporter: jgriffin, Assigned: hao)

Details

(Whiteboard: [mentor=mdas][lang=py][good first bug])

Attachments

(1 file)

Marionette uses Python's unittest runner to run tests. TextTestRunner outputs test results to stderr, instead of stdout, to avoid the buffering that takes places with stdout. Marionette's printLogs function (http://mxr.mozilla.org/mozilla-central/source/testing/marionette/client/marionette/runtests.py#65), on the other hand, just uses print, which goes to stdout. This does get buffered, and the result is, when running a sequence of tests, that the log info does not get printed immediately after a test, as is desired, but sometime later, when the stdout buffer gets flushed. To fix this, we should have printLogs output to MarionetteTextTestRunner.stream, which by default is sys.stderr.
If I made some changes to the code, how can I verify the result? Run the runtests.py?
(In reply to Hao Gao from comment #1) > If I made some changes to the code, how can I verify the result? Run the > runtests.py? Yes, you can run it with desktop Firefox using a command-line like this: python runtests.py --address localhost:2828 --binary /path/to/firefox --type browser tests/unit-tests.ini
I should add that in order to get a Firefox build that has Marionette enabled, you should download a debug build from e.g., http://stage.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/mozilla-central-linux-debug/ (or other, depending on your platform).
Attached patch a patchSplinter Review
Please review it.
Attachment #659003 - Flags: review?(jgriffin)
Comment on attachment 659003 [details] [diff] [review] a patch Review of attachment 659003 [details] [diff] [review]: ----------------------------------------------------------------- Looks great, thanks for contributing a patch!
Attachment #659003 - Flags: review?(jgriffin) → review+
Assignee: nobody → haog
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: