Android Build Server
-
Upload
trey-robinson -
Category
Engineering
-
view
109 -
download
8
Transcript of Android Build Server
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: [email protected] Github: antoinecampbell Google+: [email protected] 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