Page MenuHomePhabricator

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.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
hashar triaged this task as Medium 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

android-lint-build-page.png (287×426 px, 47 KB)

Report page

android-lint-jenkins-report.png (466×581 px, 64 KB)

File detail

android-lint-file-detail.png (455×903 px, 136 KB)

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

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