Bug 1238678 - Add job running Android unit tests in automation. r?dustin draft
authorNick Alexander <nalexander@mozilla.com>
Mon, 11 Jan 2016 15:32:52 -0800
changeset 320646 37eefe9ae0ede023f8ad485dd6c8d6a2f071aee3
parent 320645 9c3ea8d81482bb7e1a9a71afec6675c7eb5a3bb9
child 321016 7236264c45836ea4aac4841f67a037208e76f6a5
push id9259
push usernalexander@mozilla.com
push dateTue, 12 Jan 2016 02:36:58 +0000
reviewersdustin
bugs1238678
milestone46.0a1
Bug 1238678 - Add job running Android unit tests in automation. r?dustin This job looks like a frontend (--disable-compile-environment) build, followed by some Java commands (that produce build artifacts). If the Java commands fail, we should fail the job (after copying artifacts, etc). I'll add some post-processor that interprets the outputs eventually, but this pass/fail serves as a good starting point. I'd like to extract some kind of android_api_11_base.yml and re-use the configuration, but I don't really know if that's a good approach. Guidance appreciated.
testing/taskcluster/tasks/builds/android_api_11_frontend.yml
--- a/testing/taskcluster/tasks/builds/android_api_11_frontend.yml
+++ b/testing/taskcluster/tasks/builds/android_api_11_frontend.yml
@@ -42,17 +42,30 @@ task:
       MH_BUILD_POOL: taskcluster
 
     maxRunTime: 36000
 
     command:
       - bash
       - -cx
       - >
-          bin/build.sh
+          bin/build.sh &&
+          (cd /home/worker/workspace/build/src &&
+          export JAVA_HOME="/home/worker/workspace/build/src/java_home" &&
+          export PATH="$PATH:/home/worker/workspace/build/src/java_home/bin" &&
+          export MOZ_AUTOMATION=1 &&
+          export MOZ_OBJDIR="/home/worker/workspace/build/src/obj-firefox" &&
+          ./mach gradle base:testReleaseUnitTest ;
+          err=$? ;
+          cd /home/worker/workspace/build &&
+          mkdir -p /home/worker/artifacts/tests-results &&
+          cp -R $MOZ_OBJDIR/gradle/build/mobile/android/base/test-results/release /home/worker/artifacts/test-results/release ;
+          mkdir -p /home/worker/artifacts/reports/tests &&
+          cp -R $MOZ_OBJDIR/gradle/build/mobile/android/base/reports/tests/release /home/worker/artifacts/reports/tests ;
+          exit $err)
 
   extra:
     treeherderEnv:
       - production
       - staging
     treeherder:
       machine:
         # see https://github.com/mozilla/treeherder/blob/master/ui/js/values.js