Closed Bug 879683 Opened 6 years ago Closed 6 years ago

Allow MarionetteTestResult and MarionetteTextTestRunner to be subclassed


(Testing :: Marionette, defect)

Not set


(firefox22 wontfix, firefox23 wontfix, firefox24 fixed, b2g18 fixed, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 wontfix, b2g-v1.1hd fixed)

Tracking Status
firefox22 --- wontfix
firefox23 --- wontfix
firefox24 --- fixed
b2g18 --- fixed
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- wontfix
b2g-v1.1hd --- fixed


(Reporter: davehunt, Assigned: davehunt)



(1 file, 1 obsolete file)

We would like to gather additional debug for reporting in gaiatest, which would require subclassing MarionetteTestResult and MarionetteTextTestRunner.
This is working for me, but I'm requesting feedback in case there's a better approach. I have also allowed for errors to contain more than just two items in the tuple. Any additional items will be added by the subclass for reporting.
Attachment #758459 - Flags: feedback?(jgriffin)
Comment on attachment 758459 [details] [diff] [review]
Allow MarionetteTestResult and MarionetteTextTestRunner to be subclassed

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

::: testing/marionette/client/marionette/
@@ +70,5 @@
>        'END LOG:')
>      def printErrorList(self, flavour, errors):
> +        for error in errors:
> +            test, err = error[:2]

This will be fragile if we ever get inheritance chains, but for now I think it's ok.

Ideally, we'd want to integrate moztest into Marionette and use its TestResult, but that's a much bigger job.  I'll file a separate bug for that and see if I can find someone to work on it.

@@ +206,5 @@
>          self.type = type
>          self.device = device
>          self.symbols_path = symbols_path
>          self.timeout = timeout
> +        self.textrunnerclass = MarionetteTextTestRunner

Probably better to set textrunnerclass = MarionetteTextTestRunner as a class variable (like we do here:, so you don't have to reset it in a subclass after calling the super's __init__.
Attachment #758459 - Flags: feedback?(jgriffin) → feedback+
Comment on attachment 762705 [details] [diff] [review]
Allow MarionetteTestResult and MarionetteTextTestRunner to be subclassed. v1.1

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

Attachment #762705 - Flags: review?(jgriffin) → review+
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.