Merge apps/android/wikipedia Jenkins jobs lint and test
Closed, ResolvedPublic


The apps/android/wikipedia.git repository triggers two Jenkins jobs that each consume an instance. They both share gradle initialization overhead and only vary by the task invoked.

Job apps-android-wikipedia-lint invokes scripts/apps-android-wikipedia-lint:

export ANDROID_HOME="$PWD/.sdk"
./gradlew -q clean lintAlphaDebug

Job apps-android-wikipedia-test invokes scripts/apps-android-wikipedia-test:

export ANDROID_HOME="$PWD/.sdk"
./gradlew clean checkstyle assembleAlphaRelease testAlphaRelease compileAlphaReleaseAndroidTestSources

So most probably we could add lintAlphaDebug in apps-android-wikipedia-test and thus remove the -lint Jenkins job. Saving an instance in the process.

hashar created this task.Mar 24 2017, 1:34 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
hashar triaged this task as Normal priority.Mar 24 2017, 1:35 PM

It makes sense to merge these jobs for performance's sake but ideally we'd further separate these into Checkstyle, compilation, and test jobs so that failures are immediately identifiable without reviewing the console output.

We can merge the jobs and improve the readability of the test report at the same time. From a quick look:

The job apps-android-wikipedia-lint has a Zuul rule to rewrite the URL reported to Gerrit:

- name: apps-android-wikipedia-lint
  failure-pattern: '{}/{build.number}/artifact/app/build/reports/lint-results-alphaDebug.html'
  success-pattern: '{}/{build.number}/artifact/app/build/reports/lint-results-alphaDebug.html'

Browsing that HTML crafted reported is broken though since the css/javascript are not loaded by the browser.

The lintAlphaDebug task produces a file lint-results-alphaDebug.xml which is the issue report. Apparently the Android Lint Plugin can digest it and craft a nice report that would show on the build main page.

Mentioned in SAL (#wikimedia-releng) [2017-03-28T10:28:52Z] <hashar> Jenkins: installing Android Lint plugin 2.4 - T161305

Gave it a try on a test job

Build page

Report page

File detail

Jenkins job builder does not support Android Lint out of the box, but I think that can be worked around by injecting the configuration as raw HTML for now.

Change 345121 had a related patch set uploaded (by Hashar):
[apps/android/wikipedia@master] Remove lint and add lintAlphaDebug to test

Change 345122 had a related patch set uploaded (by Hashar):
[integration/config@master] Android: remove lint job

Change 345127 had a related patch set uploaded (by Hashar):
[integration/config@master] Android: generate lint report on build page


I have no idea whether a lint issue will actually fail the build properly.

@hashar, thank you! These all look good to me and ready to merge. I haven't tested your new job yet but here's a dummy patch to try it on: We're on site this week so our communications will be a bit tardy! Gotta go!

Change 345122 merged by jenkins-bot:
[integration/config@master] Android: remove lint job

Change 345127 merged by jenkins-bot:
[integration/config@master] Android: generate lint report on build page

hashar closed this task as Resolved.Mar 29 2017, 2:42 PM

The lint job has been merged in test. The test job now also process the Android lint report to show up a report on the build page.

Change 345121 merged by jenkins-bot:
[apps/android/wikipedia@master] Remove lint and add lintAlphaRelease to test