Others talk,
We listen.
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
The Android Build Server
Antoine Campbell
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
2
•  Background
•  Inspiration (Google promised, GTAC 2013: Android Testing at Scale)
•  Goals
•  Approach (circa 2013)
•  Pains
•  Approach
•  Demo
•  Build Machine
•  Questions
•  Jenkins Setup Screenshots
Overview
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
3 Background
•  UNC-Charlotte
•  B.A./M.S. Computer Science
•  Android Developer
•  2 client apps in prod, 4 supported
•  iOS Developer
•  1 enterprise app in prod
•  Web Services (SOAP, REST)
•  2 client apps in prod
•  Game Developer (former)
•  CT native / NC native
•  CapTech Consulting – 3rd year
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
4
•  Setup simple build server
•  Test Android apps
•  API levels
•  Screen sizes
•  Languages
•  Export screenshots
•  Gather test coverage
•  Gather sonar report
•  One-click-esqueness
•  Portable
Goals
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
5 Inspiration
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
6
•  Ummm……so how do we get it?
•  Work at Google
Inspiration
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
7
•  Jenkins
•  Multi-configuration Project
•  Build Matrix {API-Level}
•  Ant
•  Android Emulator Jenkins Plugin
•  Automatic emulator creation
•  Snapshots
•  Robotium
•  Emma Code Coverage
•  UIAutomator
Approach (circa 2013)
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
8 Approach (circa 2013)
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
9
•  Library projects
•  Setup local properties for all projects
•  Android Emulator Jenkins Plugin
•  Incompatible combinations
•  Emulator unlocking not guaranteed
•  Windows 7 PC – AMD Chipset
•  Limited emulator options
Pains
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
10
•  Jenkins
•  Multi-configuration Project
•  Build Matrix {Emulator, Language}
•  Gradle (Wrapper)
•  Jacoco Code Coverage Jenkins Plugin
•  Android Emulator Jenkins Plugin
•  Static Emulators (Disabled animations)
•  Espresso
•  Robotium
•  Screenshots Only
•  Sonar
•  Not Windows
Approach
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
11
•  Espresso
•  Older API levels may idle main thread before transitions
•  Thread.sleep still needed on older API levels
•  Android Emulator Jenkins Plugin
•  Still not guaranteed to unlock device
•  Fixed with shell commands to unlock device
•  Android Gradle Plugin
•  Pure unit tests not a possibility
•  Next version will support!
More Pains
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
12
DEMO
Demo
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
13
•  Lenovo ThinkServer TS140 (Core i3-4130 3.4GHz) - $269
•  Dual core
•  16 GB ECC Ram - $169
•  256 GB SSD – Free (Thanks Larry) - ~$109
•  CentOS 7 – Free
•  Total ~ $438
Build Machine
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
14
•  Multiple configurations running simultaneously
•  Automatic job creation for branching
•  Actually removing Thread.sleep from tests
•  Google promised
•  Complete test for home-screen widgets
•  UIAutomator
•  MonkeyRunner tests
•  RoboElectric tests
•  Blog
What’s Next?
15 Questions
Demo App: https://github.com/antoinecampbell/GithubUserBroswer
Email: Antoine.S.Campbell@gmail.com
Github: antoinecampbell
Google+: Antoine.S.Campbell@gmail.com
Twitter: N/A (coming soon……maybe)
Blog: http://antoine-campbell.com
Work Blog: http://www.captechconsulting.com/blog/antoine-campbell
16 Jenkins Setup Screenshots – Jenkins Plugins
17 Jenkins Setup Screenshots – Jenkins Plugins
18 Jenkins Setup Screenshots – Jenkins Settings
19 Jenkins Setup Screenshots – Jenkins Settings
20 Jenkins Setup Screenshots – Config Matrix & Emulator
21 Jenkins Setup Screenshots - Build
22 Jenkins Setup Screenshots – Post Build
23 Jenkins Setup Screenshots – Post Build
24 Sonar Screenshots

Android Build Server

  • 1.
    Others talk, We listen. Copyright© 2014 CapTech Ventures, Inc. All rights reserved. The Android Build Server Antoine Campbell
  • 2.
    Copyright © 2014CapTech Ventures, Inc. All rights reserved. 2 •  Background •  Inspiration (Google promised, GTAC 2013: Android Testing at Scale) •  Goals •  Approach (circa 2013) •  Pains •  Approach •  Demo •  Build Machine •  Questions •  Jenkins Setup Screenshots Overview
  • 3.
    Copyright © 2014CapTech Ventures, Inc. All rights reserved. 3 Background •  UNC-Charlotte •  B.A./M.S. Computer Science •  Android Developer •  2 client apps in prod, 4 supported •  iOS Developer •  1 enterprise app in prod •  Web Services (SOAP, REST) •  2 client apps in prod •  Game Developer (former) •  CT native / NC native •  CapTech Consulting – 3rd year
  • 4.
    Copyright © 2014CapTech Ventures, Inc. All rights reserved. 4 •  Setup simple build server •  Test Android apps •  API levels •  Screen sizes •  Languages •  Export screenshots •  Gather test coverage •  Gather sonar report •  One-click-esqueness •  Portable Goals
  • 5.
    Copyright © 2014CapTech Ventures, Inc. All rights reserved. 5 Inspiration
  • 6.
    Copyright © 2014CapTech Ventures, Inc. All rights reserved. 6 •  Ummm……so how do we get it? •  Work at Google Inspiration
  • 7.
    Copyright © 2014CapTech Ventures, Inc. All rights reserved. 7 •  Jenkins •  Multi-configuration Project •  Build Matrix {API-Level} •  Ant •  Android Emulator Jenkins Plugin •  Automatic emulator creation •  Snapshots •  Robotium •  Emma Code Coverage •  UIAutomator Approach (circa 2013)
  • 8.
    Copyright © 2014CapTech Ventures, Inc. All rights reserved. 8 Approach (circa 2013)
  • 9.
    Copyright © 2014CapTech Ventures, Inc. All rights reserved. 9 •  Library projects •  Setup local properties for all projects •  Android Emulator Jenkins Plugin •  Incompatible combinations •  Emulator unlocking not guaranteed •  Windows 7 PC – AMD Chipset •  Limited emulator options Pains
  • 10.
    Copyright © 2014CapTech Ventures, Inc. All rights reserved. 10 •  Jenkins •  Multi-configuration Project •  Build Matrix {Emulator, Language} •  Gradle (Wrapper) •  Jacoco Code Coverage Jenkins Plugin •  Android Emulator Jenkins Plugin •  Static Emulators (Disabled animations) •  Espresso •  Robotium •  Screenshots Only •  Sonar •  Not Windows Approach
  • 11.
    Copyright © 2014CapTech Ventures, Inc. All rights reserved. 11 •  Espresso •  Older API levels may idle main thread before transitions •  Thread.sleep still needed on older API levels •  Android Emulator Jenkins Plugin •  Still not guaranteed to unlock device •  Fixed with shell commands to unlock device •  Android Gradle Plugin •  Pure unit tests not a possibility •  Next version will support! More Pains
  • 12.
    Copyright © 2014CapTech Ventures, Inc. All rights reserved. 12 DEMO Demo
  • 13.
    Copyright © 2014CapTech Ventures, Inc. All rights reserved. 13 •  Lenovo ThinkServer TS140 (Core i3-4130 3.4GHz) - $269 •  Dual core •  16 GB ECC Ram - $169 •  256 GB SSD – Free (Thanks Larry) - ~$109 •  CentOS 7 – Free •  Total ~ $438 Build Machine
  • 14.
    Copyright © 2014CapTech Ventures, Inc. All rights reserved. 14 •  Multiple configurations running simultaneously •  Automatic job creation for branching •  Actually removing Thread.sleep from tests •  Google promised •  Complete test for home-screen widgets •  UIAutomator •  MonkeyRunner tests •  RoboElectric tests •  Blog What’s Next?
  • 15.
    15 Questions Demo App:https://github.com/antoinecampbell/GithubUserBroswer Email: Antoine.S.Campbell@gmail.com Github: antoinecampbell Google+: Antoine.S.Campbell@gmail.com Twitter: N/A (coming soon……maybe) Blog: http://antoine-campbell.com Work Blog: http://www.captechconsulting.com/blog/antoine-campbell
  • 16.
    16 Jenkins SetupScreenshots – Jenkins Plugins
  • 17.
    17 Jenkins SetupScreenshots – Jenkins Plugins
  • 18.
    18 Jenkins SetupScreenshots – Jenkins Settings
  • 19.
    19 Jenkins SetupScreenshots – Jenkins Settings
  • 20.
    20 Jenkins SetupScreenshots – Config Matrix & Emulator
  • 21.
    21 Jenkins SetupScreenshots - Build
  • 22.
    22 Jenkins SetupScreenshots – Post Build
  • 23.
    23 Jenkins SetupScreenshots – Post Build
  • 24.