Closed Bug 1056329 Opened 10 years ago Closed 10 years ago

Mochitest logging command line arguments only work for mochitest-plain

Categories

(Testing :: Mochitest, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla34

People

(Reporter: akachkach, Assigned: akachkach)

References

Details

Attachments

(1 file, 1 obsolete file)

We forgot to add command line args support for other commands (mochitest-browser, mochitest-a11y, mochitest-devtools, etc.).

This should be a straightforward change, there's just a little bug with mochitest-browser dumping options to JSON (which is problematic since we now have an stdout object in options).
Assignee: nobody → akachkach
Status: NEW → ASSIGNED
OS: Mac OS X → All
Hardware: x86 → All
Maybe a bit hack-ish for the mochitest-chrome part, but I can't find a better way to do this.
Attachment #8476314 - Flags: review?(ahalberstadt)
Comment on attachment 8476314 [details] [diff] [review]
0001-Bug-1056329-Activate-structured-logging-command-line.patch

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

::: testing/mochitest/mach_commands.py
@@ +659,5 @@
>          return self.run_mochitest(test_paths, 'a11y', **kwargs)
>  
>      @Command('webapprt-test-chrome', category='testing',
>          conditions=[conditions.is_firefox],
>          description='Run a webapprt chrome mochitest (Web App Runtime with the browser chrome).')

Did you mean to miss this one?

::: testing/mochitest/runtests.py
@@ +2012,5 @@
>  
>      if "MOZ_HIDE_RESULTS_TABLE" in os.environ and os.environ["MOZ_HIDE_RESULTS_TABLE"] == "1":
>        options.hideResultsTable = True
>  
> +    d = dict((k, v) for k, v in options.__dict__.iteritems() if not k.startswith('log'))

Is this necessary? If it isn't fixing anything, I think it might be safer to leave it as is. Also you could use a dictionary comprehension here (though that would make the file python 2.6 incompatible if it isn't already).
Attachment #8476314 - Flags: review?(ahalberstadt) → review+
(In reply to Andrew Halberstadt [:ahal] from comment #2)
> Comment on attachment 8476314 [details] [diff] [review]
> 0001-Bug-1056329-Activate-structured-logging-command-line.patch
> 
> Review of attachment 8476314 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: testing/mochitest/mach_commands.py
> @@ +659,5 @@
> >          return self.run_mochitest(test_paths, 'a11y', **kwargs)
> >  
> >      @Command('webapprt-test-chrome', category='testing',
> >          conditions=[conditions.is_firefox],
> >          description='Run a webapprt chrome mochitest (Web App Runtime with the browser chrome).')
> 
> Did you mean to miss this one?
> 

Ouch, thanks for pointing this out!

> ::: testing/mochitest/runtests.py
> @@ +2012,5 @@
> >  
> >      if "MOZ_HIDE_RESULTS_TABLE" in os.environ and os.environ["MOZ_HIDE_RESULTS_TABLE"] == "1":
> >        options.hideResultsTable = True
> >  
> > +    d = dict((k, v) for k, v in options.__dict__.iteritems() if not k.startswith('log'))
> 
> Is this necessary? If it isn't fixing anything, I think it might be safer to
> leave it as is. Also you could use a dictionary comprehension here (though
> that would make the file python 2.6 incompatible if it isn't already).

I added this because otherwise chrome tests crash: as I mentioned in the description of the bug: it will try to serialize file objects to JSON, and fail.
I also wanted to do a dict comprehension but since the rest of the code seems to be Python 2.6 compatible I didn't want to break it (arePandasRetiredYet?! :))

Will fix that missing webapprt command and submit an updated patch for checkin
carry r+ forward;

On my local setup, I can't run webapprt-chrome ("assert pathAbs.startswith(self.testRootAbs)" fails) and webapprt-test-content (some random crash), but even without my patch applied I get the same error.

ping ahal, could you test the modified commands on your setup to make sure it works as expected?
Attachment #8476314 - Attachment is obsolete: true
Attachment #8478493 - Flags: review+
Flags: needinfo?(ahalberstadt)
webapprt-test-chrome has test failures for me, but the structured logging options seem to work no problem. webapprt-test-content also works perfectly well. Thanks!
Flags: needinfo?(ahalberstadt)
Thanks for testing that!
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/b666f357e0c6
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: