SlideShare a Scribd company logo
Taming iOS Testing at Square
Santa Clara, CA, September 2-3
1
Michael Tauraso, Sr. Release Engineer
Footer
#jenkinsconf
What do I do?
CI + Release automation
for mobile app developers
I don’t write the tests
I don’t know Objective-C or Swift
I’m from a Linux + Devops background
2
Footer
#jenkinsconf
What does Square do?
Square has 4 iOS apps
Dozens of iOS developers
Several internal iOS apps
3
Footer
#jenkinsconf
What’s different about iOS?
• Mobile
• OSX and Xcode
• Velocity of ecosystem
• Closed ecosystem
4
Footer
#jenkinsconf
What’s different about iOS?
5
October November December January
February March April May
June July August September
6.1
6.2 6.3
6.4 7.0?
Footer
#jenkinsconf
What’s different about iOS?
• Mobile
• OSX and Xcode
• Velocity of ecosystem
• Closed ecosystem
6
Footer
#jenkinsconf
iOS CI @ Square 1 year ago
• 30 minute builds, longer queue times
• Manual upgrades, no scale plans
• Mysterious build failures
• Jenkins difficult to manage
• Lots of developer support + firefighting
7
Footer
#jenkinsconf
How do you make it better?
• Assume change will happen
• Know exactly what’s changing
• Control all the variables
• Deliver repeatable builds
• Keep up with Apple
8
Footer
#jenkinsconf
What are we going to talk about?
• How Square uses Jenkins
• Configuring OSX machines for builds
• Code signing on iOS
• Finding bugs in build systems
9
Footer
#jenkinsconf
What are we going to talk about?
• How Square uses Jenkins
• Configuring OSX machines for builds
• Code signing on iOS
• Finding bugs in build systems
10
Footer
#jenkinsconf
Mobile Jenkins @Square
11
Git (Stash) Stashkins Jenkins iOS-builder
Checkout Cocoapods Xcodebuild
iOS
Simulator
Footer
#jenkinsconf
Stashkins
• Uses disabled jobs as templates
• Substitutes values in Jenkins job XML
• Runs off a config file in the app’s repo
• Triggered on git-push
12
Footer
#jenkinsconf
Jenkins jobs
• Check out ios-builder on a build slave
• Run ios-builder
• Display logs, results, and artifacts
13
Footer
#jenkinsconf
Jenkins Plugins
• Promoted builds plugin
• Send packaged .ipa files to OTA site
• Warnings parser plugin
• JUnit test results plugin
• Swarm plugin
14
Footer
#jenkinsconf
Release Code
• Pattern: Factor release code to another repo
• Tweak things without touching Jenkins
• Devs don’t need/want Jenkins write access
• Easier management
• Devs edit configs on their branch
• CI + Code Review release code!
15
Footer
#jenkinsconf
Example Config
16
Footer
#jenkinsconf
Example Config
17
Footer
#jenkinsconf
Xcodebuild Needs
• Project/Workspace
• Scheme
• Configuration
• Destination
• Action
• build, test, and archive
18
Footer
#jenkinsconf
Useful Xcodebuild
• Archive is not build
• Uses more exact header search paths
• SKIP_INSTALL Project setting
• Use xcodebuild -exportArchive for ipa files
• Flag reference:
• git.io/vGDOd
19
Footer
#jenkinsconf
Xcodebuild Friends
• Loose coupling
• Frontends other than ios-builder
• facebook/xctool
• fastlane/gym
• Log output
• supermarin/xcpretty
20
Footer
#jenkinsconf
What are we going to talk about?
• How Square uses Jenkins
• Configuring OSX machines for builds
• Code signing on iOS
• Finding bugs in build systems
21
Footer
#jenkinsconf
Build slaves
• Virtualization :(
• Hardware
• Dual core Mac-Minis
• 16 GB RAM
• 256 GB SSD
• $1200 each
22
Footer
#jenkinsconf
Build slaves - DeployStudio
• Network boot
• Base image with OS X 10.10
• Installs Xcode
23
Footer
#jenkinsconf
Build slaves - Ansible
• Basic config management
• Machines ansible themselves
• Allows easy config changes
• Multiple Xcode Versions
• Swarm plugin
• Jenkins remoting version
24
Footer
#jenkinsconf
Build slaves - OSX
• Match versions with Xcode
• Never sleep (caffeinate command)
• Turn off:
• Software update
• spotlight
• bonjour
• ssh w/password + VNC
25
Footer
#jenkinsconf
Build slaves - Xcode
• Always have a GUI context!
• Automatic login
• swarm as a LaunchAgent
• TCC Database
• git.io/osx-tcc
• DevToolsSecurity
26
Footer
#jenkinsconf
Build slaves - Xcode Packaging
• Xcode likes to install things on first-startup
• iOS SDKs installed via Xcode
• Command line tools are another package
• We record installs with Composer
• (JAMF software)
• Side-by-side xcode versions with jenkins
labels + xcode-select
27
Footer
#jenkinsconf
Build slaves - More detail
• https://corner.squareup.com/2015/07/ios-build-
infrastructure.html
28
Footer
#jenkinsconf
What are we going to talk about?
• How Square uses Jenkins
• Configuring OSX machines for builds
• Code signing on iOS
• Finding bugs in build systems
29
Footer
#jenkinsconf
Code signing
• Its confusing
• The error messages are unclear
• Apple changes things
• Apple Watch!
• Swift!
• Your app needs it to run
30
Footer
#jenkinsconf
Code signing
• Provisioning Profiles
• Signing Identity
31
Footer
#jenkinsconf
Code signing - Mobileprovision
• Message from Apple to iPhone
• These devices
• Can run this app (app ID)
• With these permissions (entitlements)
• So long as ( ) signed the code
32
Footer
#jenkinsconf
Code signing - Mobileprovision
• is a plist in CMS format
• Signing identities are just x509 certs
• emonti/pliney
• Parse + check for developer errors
33
Footer
#jenkinsconf
Code signing - Xcode
• Xcode “helps”
• Restrict Mobileprovision directory in CI
• ~/Library/MobileDevice/Provisioning Profiles
• Apple Watch apps
• Multiple mobileprovision files
• All on the same signing identity
34
Footer
#jenkinsconf
Code signing - HSM
• Yubikey-NEO
• Acts as an HSM
• Signing identity available through keychain
• Key never touches a hard-drive
35
Footer
#jenkinsconf
Code signing - Yubikeys
• Can create on-device or import existing
• Needs OpenSC (+reboot)
• OpenSC/OpenSC
• Needs yubikey-piv-tool
• https://developers.yubico.com/yubico-piv-tool/Releases/
• Tutorial
• https://developers.yubico.com/yubico-piv-tool/
OS_X_code_signing.html
36
Footer
#jenkinsconf
What are we going to talk about?
• How Square uses Jenkins
• Configuring OSX machines for builds
• Code signing on iOS
• Finding bugs in build systems
37
Footer
#jenkinsconf
Build Stability
• Dozens of dev make 100s of builds
• 1 in 100 failures happen every day
• Builds that work sometimes are frustrating
• Green builds usually result in code merging
• “Sometimes” errors accumulate
38
Footer
#jenkinsconf
Build Stability
• Run passing builds at night!
• Use our idle infrastructure
• How green are they really?
39
Footer
#jenkinsconf
Build Stability — Statistics
• Builds are very unfair coins
• Binomial distribution
• Wilson score for confidence interval
40
Footer
#jenkinsconf
Build Stability
41
2 failures
300 builds
Footer
#jenkinsconf
Build Stability — Statistics
• Count individual failure types
• Allocate investigative resources
• Keep an SLA (99.5%)
42
Footer
#jenkinsconf
Build Stability
43
2 failures 300 builds
0.66%
6 failures 900 builds
0.66%
Footer
#jenkinsconf
Build Stability — Statistics
• Found Xcode bugs
• Reduced failure rate to 0.5%
• More detail:
• https://corner.squareup.com/2015/06/build-stability.html
44
Footer
#jenkinsconf
Where are we now?
• 3x as many tests, lower build time
• 99.5% SLA. We file bugs for bad tests
• Many developer requests are self-serve
• Growing cluster with developer hiring
• Supporting latest Apple hardware
45
#jenkinsconf
Footer
Thanks to our Sponsors!
46
Footer
#jenkinsconf
Questions?
Michael Tauraso
mtauraso@{gmail,squareup}.com
@mtauraso
mtauraso
47
#jenkinsconf
Footer
Thanks to our Sponsors!
48
Taming iOS Testing
Santa Clara, CA, September 2-3
49

More Related Content

PDF
10+ Deploys Per Day: Dev and Ops Cooperation at Flickr
PDF
iOS Build Infrastructure at Square
PDF
Spec et test agile sur mobile @airfrance #at lille & cocoaheads tls
KEY
Building Pistachio with Sencha Touch 2 (introductory)
PDF
Configuration As Code - Adoption of the Job DSL Plugin at Netflix
PPTX
Cross-Platform Desktop Apps with Electron
PDF
PDF
Cross-Platform Desktop Apps with Electron (CodeStock Edition)
10+ Deploys Per Day: Dev and Ops Cooperation at Flickr
iOS Build Infrastructure at Square
Spec et test agile sur mobile @airfrance #at lille & cocoaheads tls
Building Pistachio with Sencha Touch 2 (introductory)
Configuration As Code - Adoption of the Job DSL Plugin at Netflix
Cross-Platform Desktop Apps with Electron
Cross-Platform Desktop Apps with Electron (CodeStock Edition)

What's hot (19)

PDF
Cross-Platform Desktop Apps with Electron (Condensed Version)
PPTX
Philly CocoaHeads 20160414 - Building Your App SDK With Swift
PDF
Cross-Platform Desktop Apps with Electron
PDF
Jenkins
PDF
Containerization using docker
PPTX
Docker for .NET Developers
KEY
iPhone/iPad开发讲座 第一讲 Ios开发简介
PPTX
Automation of online games
PDF
Respawn 2015: Chimera Entertainment - A decade of game development
PDF
Docker get started
PPTX
Containers #101 Meetup: Building a micro-service using Node.js and Docker - P...
PPTX
Jenkins workflows and Best Practices
PDF
Docker 101 for Developer
PDF
Building Native Experiences with Electron
PPTX
Inspect The Uninspected
PDF
Calabash Andoird + Calabash iOS
PPTX
Intro to Ionic for Building Hybrid Mobile Applications
PDF
DevOps goes Mobile (daho.am)
PDF
Innovation dank DevOps (DevOpsCon Berlin 2015)
Cross-Platform Desktop Apps with Electron (Condensed Version)
Philly CocoaHeads 20160414 - Building Your App SDK With Swift
Cross-Platform Desktop Apps with Electron
Jenkins
Containerization using docker
Docker for .NET Developers
iPhone/iPad开发讲座 第一讲 Ios开发简介
Automation of online games
Respawn 2015: Chimera Entertainment - A decade of game development
Docker get started
Containers #101 Meetup: Building a micro-service using Node.js and Docker - P...
Jenkins workflows and Best Practices
Docker 101 for Developer
Building Native Experiences with Electron
Inspect The Uninspected
Calabash Andoird + Calabash iOS
Intro to Ionic for Building Hybrid Mobile Applications
DevOps goes Mobile (daho.am)
Innovation dank DevOps (DevOpsCon Berlin 2015)
Ad

Viewers also liked (14)

PDF
20 Upcoming Cars In India Worth to Wait 2016-17
PPTX
Prescripcion
PPT
unidad 1 teoria_del_conflicto
DOC
Ilicitos tributarios carlos monasterio
PPTX
Le melissa in cucina
DOCX
Contratos
PPTX
Clase numero 03 clasificacion de los masc y conciliacion en equidad 2016
DOCX
Ilicito tributario
PDF
PDF
Manual evamat vol.1
PPTX
Conteciosio administrativo tributario
PPTX
Glandulas salivales
PDF
Supuestos Generadores de Responsabilidad Administrativa previstos (sólo) en l...
PPTX
Selfie 54m 2 dorms
20 Upcoming Cars In India Worth to Wait 2016-17
Prescripcion
unidad 1 teoria_del_conflicto
Ilicitos tributarios carlos monasterio
Le melissa in cucina
Contratos
Clase numero 03 clasificacion de los masc y conciliacion en equidad 2016
Ilicito tributario
Manual evamat vol.1
Conteciosio administrativo tributario
Glandulas salivales
Supuestos Generadores de Responsabilidad Administrativa previstos (sólo) en l...
Selfie 54m 2 dorms
Ad

Similar to Taming iOS Testing at Square -- JUC West 2015 (20)

PDF
Hands on iOS developments with Jenkins
PDF
Continuous Cross Platform Mobile App Development using Jenkins Build Server
PPTX
Ciprian redinciuc continuous integration with jenkins for i os
PPTX
Jenkins CI/CD setup for iOS in Mac OSX
PPTX
Aleksey_Demedetskiy_Jenkins
PDF
Ci for i-os-codemash-01.2013
PDF
Continuous Integration with Hackintosh
PDF
Setup Build & Deploy with Jenkins CI
PPTX
Continuous integration by Rémy Virin
PPTX
CI in the mobile world
PDF
Jazoon12 355 aleksandra_gavrilovska-1
PDF
Graduating to Jenkins CI for Ruby(-on-Rails) Teams
PDF
Jenkins CI for MacDevOps
PDF
Survival of the Continuist
PDF
JUC Europe 2015: Jenkins-Based Continuous Integration for Heterogeneous Hardw...
PDF
Hands on iOS developments with jenkins
PPTX
Continuos integration with Jenkins for iOS | SuperSpeakers@CodeCamp Iasi, 2014
PDF
Jenkins-CI
PPTX
Jenkins User Conference 2013: Literate, multi-branch, mobile and more
PPTX
JenkinsMobi: Jenkins XML API for Mobile Applications
Hands on iOS developments with Jenkins
Continuous Cross Platform Mobile App Development using Jenkins Build Server
Ciprian redinciuc continuous integration with jenkins for i os
Jenkins CI/CD setup for iOS in Mac OSX
Aleksey_Demedetskiy_Jenkins
Ci for i-os-codemash-01.2013
Continuous Integration with Hackintosh
Setup Build & Deploy with Jenkins CI
Continuous integration by Rémy Virin
CI in the mobile world
Jazoon12 355 aleksandra_gavrilovska-1
Graduating to Jenkins CI for Ruby(-on-Rails) Teams
Jenkins CI for MacDevOps
Survival of the Continuist
JUC Europe 2015: Jenkins-Based Continuous Integration for Heterogeneous Hardw...
Hands on iOS developments with jenkins
Continuos integration with Jenkins for iOS | SuperSpeakers@CodeCamp Iasi, 2014
Jenkins-CI
Jenkins User Conference 2013: Literate, multi-branch, mobile and more
JenkinsMobi: Jenkins XML API for Mobile Applications

Recently uploaded (20)

PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Machine learning based COVID-19 study performance prediction
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Encapsulation theory and applications.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Electronic commerce courselecture one. Pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Approach and Philosophy of On baking technology
PPTX
A Presentation on Artificial Intelligence
PDF
cuic standard and advanced reporting.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Chapter 3 Spatial Domain Image Processing.pdf
Empathic Computing: Creating Shared Understanding
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Machine learning based COVID-19 study performance prediction
Network Security Unit 5.pdf for BCA BBA.
Encapsulation theory and applications.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Electronic commerce courselecture one. Pdf
Building Integrated photovoltaic BIPV_UPV.pdf
The AUB Centre for AI in Media Proposal.docx
Approach and Philosophy of On baking technology
A Presentation on Artificial Intelligence
cuic standard and advanced reporting.pdf
Review of recent advances in non-invasive hemoglobin estimation
Understanding_Digital_Forensics_Presentation.pptx
Unlocking AI with Model Context Protocol (MCP)

Taming iOS Testing at Square -- JUC West 2015