Closed Bug 903537 Opened 11 years ago Closed 6 years ago

Write python test script for running Fennec instrumentation test APK

Categories

(Firefox Build System :: Android Studio and Gradle Integration, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: nalexander, Assigned: nalexander)

References

(Depends on 1 open bug)

Details

Attachments

(1 file)

This is the conclusion of Bug 903531 and Bug 903534.  Once we have the test suite in m-c, and the build system building the Fennec instrumentation APK, we need a script to run it -- both locally and on TBPL.

This script probably looks like a cleaner version of

http://mxr.mozilla.org/mozilla-central/source/testing/xpcshell/remotexpcshelltests.py

and

http://mxr.mozilla.org/mozilla-central/source/testing/mochitest/runtestsremote.py

This will require outreach with the ateam, so that we follow there best practices.  At some point, jhamel suggested to me that this part was pretty free-form and not difficult to make happen on TBPL.

One consideration: this script needs to translate instrumentation test errors into TBPL errors.  This could be done by the script, or by writing a custom JUnit test runner that gets built into the instrumentation testing APK.
Blocks: 709353
Depends on: 919627
Hi gbrown, I'm starting to write the script for running these
background instrumentation tests on TBPL.  It'll be similar to
runtestsremote.py but simpler (I hope) since it needs to do less.
Here's a little clean-up and unification patch that I'll use.  There
are a few more places that could be unified, but that would mean
changing argument names :(
Attachment #833125 - Flags: review?(gbrown)
Assignee: nobody → nalexander
Status: NEW → ASSIGNED
(In reply to Nick Alexander :nalexander from comment #1)
> Created attachment 833125 [details] [diff] [review]
> Part 1: Define and use common remote options in automationutils.
> 
> Hi gbrown, I'm starting to write the script for running these
> background instrumentation tests on TBPL.  It'll be similar to
> runtestsremote.py but simpler (I hope) since it needs to do less.
> Here's a little clean-up and unification patch that I'll use.  There
> are a few more places that could be unified, but that would mean
> changing argument names :(

I missed at least one thing: testing/xpcshell/remotexpcshelltests.py needs to have remoteTestRoot option removed as well.
Comment on attachment 833125 [details] [diff] [review]
Part 1: Define and use common remote options in automationutils.

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

It's a simple change, but hits all of the Android unit tests, which have lots of use cases...are you sure you want to do that?

The try run looks awful. Ping me again when that's green and you have verified that the tests still run locally with adb and sut.

::: build/automationutils.py
@@ +223,5 @@
> +
> +  if not deviceIP:
> +    raise devicemanager.DMError("You must provide a device IP to connect to with dm_trans=sut")
> +
> +  return devicemanagerSUT.DeviceManagerSUT(deviceIP, devicePort, deviceRoot=remoteTestRoot)

This won't work, will it? Some clients use DroidSUT instead of DeviceManagerSUT.
Attachment #833125 - Flags: review?(gbrown)
Blocks: 1022037
Depends on: 1069648
chmanchester: Over at [1], I have used the build API to trigger a job with a hacked up tests.zip.  Said tests.zip has most of a runinstrumentation.py script in place.  It seems to be mostly working, but I have a question.  I'd like to show the entire Java stack trace rather than just the first line in the "summary" view.  How would you suggest I do that?

[1] https://treeherder.mozilla.org/ui/logviewer.html#?job_id=62189&repo=ash
Flags: needinfo?(cmanchester)
(In reply to Nick Alexander :nalexander from comment #8)
> chmanchester: Over at [1], I have used the build API to trigger a job with a
> hacked up tests.zip.  Said tests.zip has most of a runinstrumentation.py
> script in place.  It seems to be mostly working, but I have a question.  I'd
> like to show the entire Java stack trace rather than just the first line in
> the "summary" view.  How would you suggest I do that?
> 
> [1] https://treeherder.mozilla.org/ui/logviewer.html#?job_id=62189&repo=ash

The treeherder logviewer predates structured logging and I don't think it's been retrofitted to consume JSON logs. I expect it's still line based and regex based, so we probably don't have a great answer for this. The summary in the upper right of the page appears to be line oriented: I might suggest a way to output something from mozharness or format the stack in a way that would trigger the tool's regex, but then I suspect each line would be a separate link in the summary view, and that might be misleading in its own right.

I would drop in to #treeherder for more definitive answers on the logviewer tool.
Flags: needinfo?(cmanchester)
Depends on: 1093218
Nick, still relevant?
Component: Build & Test → Build Config & IDE Support
Flags: needinfo?(nalexander)
Product: Android Background Services → Firefox for Android
(In reply to Michael Comella (:mcomella) from comment #10)
> Nick, still relevant?

Not really -- any new instrumentation test suite would run through GeckoView and hopefully through Gradle's androidTest rather than a bespoke instrumentation runner in Python.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Flags: needinfo?(nalexander)
Resolution: --- → WONTFIX
Product: Firefox for Android → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: