Closed Bug 1120727 Opened 5 years ago Closed 5 years ago

Add mach commands for mochitest-plain and mochitest-chrome on Android


(Firefox for Android :: Testing, defect)

Not set



Firefox 40
Tracking Status
firefox40 --- fixed


(Reporter: gbrown, Assigned: gbrown)




(1 file, 1 obsolete file)

On Android, we have a mach command to run robocop tests, but none for plain mochitests. Plain mochitests can be run locally by calling directly, or with the mochitest-remote make target.

With patches landed in bug 1026290, it is now possible to run mochitest-chrome tests on Android via, but there is no make target and no mach command.
Just to note, I plan on completely overhauling the mochitest very soon. I'm going to move all of the logic out of and into the test harness. So depending how close you are to landing this, either I should wait for you to land, or you should wait for me (though I haven't started writing the patch yet, so you're likely closer).
Depends on: 1046992
See Also: 1046992
(In reply to Andrew Halberstadt [:ahal] from comment #2)
> I'm going to move all of the logic out of
> and into the test harness. 

I like that idea.
This adds rudimentary support for "mochitest-plain" and "mochitest-chrome" on Android.

Many of the advanced options supported on desktop (chunking, tags, etc) are ignored on Android; we can always follow-up.

As for B2G, if more than one test path is requested, only the first is used and a warning is printed.

I have not added any Android-specific options. Prime candidates would be for selecting device manager, device IP, etc. Newer Android tests on treeherder are using adb and sutagent runs into trouble with newer androids because of selinux security, so I am starting to think that we should retire sutagent, or at least de-emphasize it.

I have tested:
 - mochitest-plain and mochitest-chrome continue to work on desktop
 - on Android:
     ./mach mochitest-plain
     ./mach mochitest-plain <test-dir>
     ./mach mochitest-plain <test-file>
     ./mach mochitest-chrome
     ./mach mochitest-chrome <test-dir>
     ./mach mochitest-chrome <test-file>
     ./mach robocop
     ./mach robocop <test-name>
 - on Android, all of the above complain if MOZ_HOST_BIN is not defined, or defined incorrectly.
Attachment #8547862 - Attachment is obsolete: true
Attachment #8590380 - Flags: review?(ahalberstadt)
Comment on attachment 8590380 [details] [diff] [review]
add mochitest-plain and mochitest-chrome support for Android

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

::: testing/mochitest/
@@ +1044,5 @@
>          mochitest = self._spawn(MochitestRunner)
>          return mochitest.run_b2g_test(test_paths=test_paths, **kwargs)
> +    def run_mochitest_android(self, test_paths, chrome=False, **kwargs):

Because this is using _st_parser, people will see the full set of options when running --help. These show up in kwargs, but will be ignored which could cause confusion. It would be good to do something like [1] so they get forwarded on to the harness. But if you want to land this as is for now and do the rest in a follow up, that's fine with me.

Attachment #8590380 - Flags: review?(ahalberstadt) → review+
Blocks: 1152944
No changes to reviewed patch; filed 1152944 for improvements.
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 40
You need to log in before you can comment on or make changes to this bug.