Closed Bug 908275 Opened 8 years ago Closed 8 years ago

Improve logging for mochitest-remote and mochitest-robocop


(Testing :: Mochitest, defect)

Not set


(Not tracked)



(Reporter: gbrown, Assigned: gbrown)



(2 files, 1 obsolete file)

There are a couple of logging issues bugging me. Best to explain with patches...

args: [u'/home/mozdev/objdirs/firefox/dist/bin/xpcshell', '-g', '/home/mozdev/objdirs/firefox/dist/bin', '-v', '170', '-f', '/home/mozdev/objdirs/x86/_tests/testing/mochitest/httpd.js', '-e', "const _PROFILE_PATH = '/tmp/tmp5nVpcc';const _SERVER_PORT = '8888'; const _SERVER_ADDR = '';\n                     const _TEST_PREFIX = undefined; const _DISPLAY_RESULTS = false;", '-f', './server.js']


INFO | | Launching: [u'/builds/tegra-160/test/build/hostutils/bin/xpcshell', '-g', '/builds/tegra-160/test/build/hostutils/xre', '-v', '170', '-f', '/builds/tegra-160/test/build/hostutils/bin/components/httpd.js', '-e', "const _PROFILE_PATH = '/tmp/tmpnHocm7'; const _SERVER_PORT = '30160'; const _SERVER_ADDR = ''; const _TEST_PREFIX = undefined; const _DISPLAY_RESULTS = false;", '-f', './server.js']
Attachment #794128 - Flags: review?(jmaher)
Use mozlog calls instead of "print" in mochitest/

My main motivation for this is that I have been seeing some long lines split recently -- especially SCREENSHOT lines. I have not tracked down the cause, but I think it best if we use one logging interface consistently. I have not seen any split lines with this patch.

Try run, with intentional test failures, at
Attachment #794138 - Flags: review?(jmaher)
Comment on attachment 794138 [details] [diff] [review]
(2) use mozlog in

Oops - I noticed a problem in the try run.
Attachment #794138 - Flags: review?(jmaher)
Comment on attachment 794128 [details] [diff] [review]
(1) tidy xpcshell args logging

Review of attachment 794128 [details] [diff] [review]:

::: build/
@@ +217,5 @@
>                   universal_newlines=False,
>                   startupinfo=None,
>                   creationflags=0):
>        args = automationutils.wrapCommand(args)
> +"INFO | | Launching: %s", args)

I would like to make this easier to copy/paste for running, right now args is a python list.  We could either add another command or adjust this one:"INFO | | Launching: %s", subprocess.list2cmdline(args))
Attachment #794128 - Flags: review?(jmaher) → review+
(1) landed with list2cmdline change:

I still aspire to land patch (2)...
Whiteboard: [leave open]
Functionally, the main change here is to use mozlog instead of print for dumping screenshots. I do not have conclusive proof that this fixes the intermittent problem with split screenshots in test logs, but I have not seen the problem in any of my try runs.

Other print->mozlog changes make the output a little tidier and more consistent.

A few print's remain, particularly for the test summary. Changing these to mozlog changes the order of output in the final logs, which seems to confuse the tbpl summary.

Here's a try run that includes an intentional failure in a robocop test, to show both success and failure logging:
Attachment #794138 - Attachment is obsolete: true
Attachment #798871 - Flags: review?(jmaher)
Comment on attachment 798871 [details] [diff] [review]
(2) use mozlog in

Review of attachment 798871 [details] [diff] [review]:


::: testing/mochitest/
@@ +479,5 @@
>      def printDeviceInfo(self, printLogcat=False):
>          try:
>              if printLogcat:
>                  logcat = self._dm.getLogcat(filterOutRegexps=fennecLogcatFilters)
> +      '\n'+(''.join(logcat)))

I assume this was tested, it just looks odd.  Why the () around the .join ?
Attachment #798871 - Flags: review?(jmaher) → review+
(In reply to Joel Maher (:jmaher) from comment #8)
> > +      '\n'+(''.join(logcat)))
> I assume this was tested, it just looks odd.  Why the () around the .join ?

I thought it looked odd without the ():


I wanted to make clear that we're logging a newline + (the joined logcat), distinct from '\n'.join(logcat), which might be expected.
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in before you can comment on or make changes to this bug.