Closed Bug 1084565 Opened 10 years ago Closed 10 years ago

Add option to output logcat to stdout

Categories

(Remote Protocol :: Marionette, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla36

People

(Reporter: mdas, Assigned: rwood)

References

Details

Attachments

(1 file, 1 obsolete file)

Marionette client should have a cli argument to output the logcat to stdout. Frankly, this is a stopgap measure for Bug 1069641, but I think it is also valuable to have interlaced logging for debugging purposes.

One way to do this is to clear the logs before running "adb logcat -c", then output the logcat after a test runs, clear the log, and repeat for each test run. You can probably add this to B2GTestResultMixin (https://mxr.mozilla.org/mozilla-central/source/testing/marionette/client/marionette/runner/mixins/b2g.py)
This may increase test run time. We'll have to monitor that in try, and if it's too long, we can instead dump the log after each test file instead of each test. Or periodically...
Attached patch bug1084565.patch (obsolete) — Splinter Review
Thanks for your help on IRC!
Attachment #8508256 - Flags: review?(mdas)
Comment on attachment 8508256 [details] [diff] [review]
bug1084565.patch

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

Other than that, this looks really good!

::: testing/marionette/client/marionette/runner/base.py
@@ +211,5 @@
>                  if dm_type == 'adb':
> +                    dm = get_dm(self.marionette)
> +                    self.b2g_pid = get_b2g_pid(dm)
> +                    if self.logcat_stdout:
> +                        dm.shellCheckOutput(['/system/bin/logcat', '-c'])

on second thought, we should just clear the logcat after we write it instead of here. That way, all the logcat that existed before the test will be outputted, which could be useful for debugging if an error occurred in gecko/gaia before the tests even run.
and 1am is a perfectly reasonable time to do patch reviews.
Thanks Mdas! Hope this one is a more reasonable hour haha
Attachment #8508256 - Attachment is obsolete: true
Attachment #8508256 - Flags: review?(mdas)
Attachment #8508712 - Flags: review?(mdas)
Comment on attachment 8508712 [details] [diff] [review]
bug1084565_take2.patch

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

awesome, thanks!
Attachment #8508712 - Flags: review?(mdas) → review+
https://hg.mozilla.org/mozilla-central/rev/b0186ba5fc0c
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
We need to uplift this to everything mozharness/scripts/marionette.py  touches...
Marking myself as ni? to uplift
Flags: needinfo?(mdas)
mozharness scripts will be per branch, and we can update them by request. There isn't a need right now.
Flags: needinfo?(mdas)
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: