Ah ok, it would certainly be possible as integration involves calling an arbitrary python function, but sounds like it might be clunky. Especially if it's not possible to lint individual files rather than the whole thing at once. That would negate most if not all of the benefit of integrating with mozlint.
On 24/02/16 05:07 PM, Nicholas Alexander wrote:
On Wed, Feb 24, 2016 at 1:46 PM, Andrew Halberstadt <[email protected] <mailto:[email protected]>> wrote: Cool! I was actually just working on my mozlint prototype this past weekend. I have eslint and flake8 working, I'll see if I can get gradle lint integrated as well. Android Gradle lint is rather more like a build than a lint. That is, we need a mozconfig for Fennec, and we need to run non-trivial build steps, including the export tier. Do try it, but don't expect this to be smooth. Nick I'm trying to provide a standardized way of adding lints to various places, like mach, mozreview or taskcluster. So e.g |mach lint testing/mochitest| would run both eslint and flake8 (as that directory contains both .py and .js files). If you (or anyone reading this) are interested, I put up a patch in bug 1230962 and wouldn't mind some early feedback. Andrew On 24/02/16 03:06 PM, Nicholas Alexander wrote: Hi y'all, We are now running Android unit tests and Android lint in automation: Bug 1249166 [1]. You can see an example of this job at https://treeherder.mozilla.org/#/jobs?repo=fx-team&revision=057c0e7cf189 -- it's the one labeled "Android 4.0 API15+ opt tc[Tier-2] (Unit)". (I have no concrete plan to upgrade this to Tier 1 -- guidance appreciated.) The new job is Android API 15 only and runs Gradle in automation. It produces a special --disable-compile-environment Fennec and Gradle build, followed by two |mach gradle| commands (one for unit tests and one for lint) [2]. Automation results ================== The unit test and lint reports are uploaded to Task Cluster. If you tap "Unit", then "Taskcluster: Inspect Task" (in the bottom-left corner), you should see a number of "Artifacts". (Not related to artifact builds, at least not directly.) The two you want are (currently): public/android/unittest/automationDebug/index.html public/android/lint/lint-results-automationDebug.html For example: https://public-artifacts.taskcluster.net/UP3W7OHwQEGYNmHbPc5-pQ/0/public/android/unittest/automationDebug/index.html https://public-artifacts.taskcluster.net/UP3W7OHwQEGYNmHbPc5-pQ/0/public/android/lint/lint-results-automationDebug.html Local results ============= To run the unit tests locally, run |mach gradle test|. (The command in automation is a subset of this.) If the unit tests fail in automation, this will burn the tree. Since the job is Tier 2, you shouldn't be backed out -- but you will be a Bad Citizen and should co-ordinate with the Fennec team to greenify the tree. During development, you can run these tests directly inside of Android Studio. Generally, this means right clicking a test class or test method and choosing to "Run". To run lint locally, run |mach gradle lint|. It's not currently possible to burn the tree by introducing additional lint issues. Bug 1170283 [3] tracks burning down (fixing or ignoring) these lint issues, so that we can make regressing lint a red tree. Documentation ============= There is none. Android unit testing is very different to the existing Robocop suite, and completely different from existing Mochitest/Reftest/etc suites. The Fennec team is slowly disseminating Android unit testing knowledge throughout the team, but for now there's nothing written down. Look in https://dxr.mozilla.org/mozilla-central/source/mobile/android/tests/background/junit4 for existing examples; read http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Unit-testing for configuration details; and dig into http://junit.org, http://robolectric.org, and http://mockito.org for documentation on the tools and frameworks we're using. Acknowledgments ================ The Task Cluster team made this possible. In particular, Dustin J. Mitchell (:dustin) has been *absolutely invaluable* in getting this running. Jonas Finnemann Jensen (:jonasfj) also deserves recognition. Jordan Lund (:jlund) provided valuable mozharness help and reviews. Dave Townsend (:Mossop) led the way by showing how to get eslint running in the tree. Finally, Mike Comella (:mcomella) has been a champion for Android Lint for a long time and has done most of the legwork to make the Lint results valuable. My thanks to you all. Best, Nick [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1249166 [2] https://hg.mozilla.org/integration/fx-team/rev/b7f1dac8306f#l1.11 [3] https://bugzilla.mozilla.org/show_bug.cgi?id=1170283 _______________________________________________ dev-builds mailing list [email protected] <mailto:[email protected]> https://lists.mozilla.org/listinfo/dev-builds
_______________________________________________ dev-builds mailing list [email protected] https://lists.mozilla.org/listinfo/dev-builds

