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

Add option to output logcat to stdout

RESOLVED FIXED in mozilla36

Status

Testing
Marionette
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: mdas, Assigned: rwood)

Tracking

Trunk
mozilla36
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

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

Comment 2

3 years ago
Created attachment 8508256 [details] [diff] [review]
bug1084565.patch

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

Comment 5

3 years ago
Created attachment 8508712 [details] [diff] [review]
bug1084565_take2.patch

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+
Keywords: checkin-needed
(Assignee)

Comment 7

3 years ago
https://tbpl.mozilla.org/?tree=Try&rev=28b4d649967a
https://hg.mozilla.org/integration/mozilla-inbound/rev/b0186ba5fc0c
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/b0186ba5fc0c
Status: NEW → RESOLVED
Last Resolved: 3 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)
Blocks: 1095635
mozharness scripts will be per branch, and we can update them by request. There isn't a need right now.
Flags: needinfo?(mdas)
You need to log in before you can comment on or make changes to this bug.