Closed Bug 1171566 Opened 5 years ago Closed 5 years ago

Make it easy to run Android JUnit 3 browser and background instrumentation tests locally

Categories

(Firefox for Android :: Testing, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 41
Tracking Status
firefox41 --- fixed

People

(Reporter: nalexander, Assigned: nalexander)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

This ticket tracks making it easy to run the existing Android JUnit 3 instrumentation test suites (browser and background) locally.  This avoids a bunch of pain arranging for debug APKs to get to TBPL, and writing mozharness test runners.
Bug 1171566 - Part 1: Configure Gradle and Spoon. r?mcomella,liuche

There are few things happening here:

* A purely mechanical move of test sources into org.mozilla.test.browser.junit3.
  This is only to make it easy to specify the suite in Spoon.  (But it has the
  advantage of making it possible to move files around in IntelliJ, since the
  symlink points to src instead of org/mozilla/gecko.)

* Specifying the suite (package name) ended up requiring changes to the
  spoon-gradle-plugin anyway.  Hence, I've included this custom
  spoon-gradle-plugin version locally, while I work to upstream the changes.

* Some Gradle trickery to make |mach gradle runBrowserTests| execute Spoon with
  the correct package name.
Attachment #8615504 - Flags: review?(michael.l.comella)
Attachment #8615504 - Flags: review?(liuche)
Bug 1171566 - Part 2: Remove BrowserTestCase. r?mcomella,liuche

This was just a remnant from earlier days.  This launched the Fennec
activity, which is absolutely *not* something we want to do during
these browser JUnit 3 tests.  That is, these should be pure
instrumentation tests that just run Java code in the correct package
and Java classloader context.  They shouldn't interact with the App
lifecycle at all.

Not all the tests pass; I took a shot at fixing one but don't care to
dig deeply right now.
Attachment #8615505 - Flags: review?(michael.l.comella)
Attachment #8615505 - Flags: review?(liuche)
Comment on attachment 8615504 [details]
MozReview Request: Bug 1171566 - Part 1: Configure Gradle and Spoon. r?mcomella,liuche

https://reviewboard.mozilla.org/r/10283/#review9073

Ship It!
Attachment #8615504 - Flags: review?(michael.l.comella) → review+
Comment on attachment 8615505 [details]
MozReview Request: Bug 1171566 - Part 2: Remove BrowserTestCase. r?mcomella,liuche

https://reviewboard.mozilla.org/r/10285/#review9077

Ship It!
Attachment #8615505 - Flags: review?(michael.l.comella) → review+
Given what I know and understand, lgtm - I think I'll have to do some research on Gradle syntax and layout before I really understand what's going on here though.
Assignee: nobody → nalexander
NI self to try this locally (oops!).
Flags: needinfo?(michael.l.comella)
Move fast and [try not to] break things!
Status: NEW → ASSIGNED
Running locally wfm but I had to remove roboexample and fennec_mcomella.
Flags: needinfo?(michael.l.comella)
Attachment #8615504 - Flags: review?(liuche)
Attachment #8615505 - Flags: review?(liuche)
Blocks: 1248005
Blocks: 1411667
You need to log in before you can comment on or make changes to this bug.