With Apple’s App Store review process, making your submission bug-free and high-quality is of utmost importance. Continuous Integration is a testing practice utilized to ensure a highly-tested build is always available for shipping. Jenkins is a popular continuous integration suite, but it was not designed for iOS development and has several limitations. Apple released their continuous integration server, Xcode Server, with Xcode 5 last summer. In the talk, we examine the prerequisites to setting up continuous integration, the details of creating bots on Xcode Server, and the features that are available on Xcode Server along with their uses. Finally, we present a list of caveats to be aware of when planning a continuous integration implementation.
Kiel Oleson is an iOS Mobile Software Engineer at Eventbrite in San Francisco. Since joining Eventbrite in 2010 as their first dedicated iOS engineer, he has led from-scratch development of Eventbrite’s eponymous application for event attendees and Eventbrite At The Door, a ticket point-of-sale system. Prior to writing software for iOS, he wrote WebKit-based software for Mac OS X with Cocoa and Qt. Kiel is an advocate of test-driven development and continuous integration in the iOS community, from its roots in UIAutomation, OCUnit and shell scripts to today’s KIF, XCTest, and Xcode Server.
Kiel moved to San Francisco from Missouri and is a graduate of the Raikes School at the University of Nebraska. When he isn’t improving his software’s reliability and user experience, he is in his car trying to improve his lap times at the racetrack.
14. TESTS
• You are writing tests, right?
• OCUnit
• XCTest
• Something else?
• Too bad!
15. MAKINGTESTS POSSIBLE
• KIF
• Test your UI like a user!
• Mock Objects
• Test your objects like a
caller!
!
• Mock Server
• Test your API responses
without a server!
16. ASIDE: KIF
• You are making your app accessible, right?
• Use accessibility labels to UI test your app
• KIF-Next aka KIF 3.0
• XCTest-based
• https://github.com/kif-framework/KIF
17. ASIDE: TEST BUNDLES
• OCUnit and XCTest run inside main target
• Need to be crafty to make certain things work
• Location Services without human interaction
• Clearing Core Data, etc.
20. TEST NAVIGATOR
• You are running your tests, right?
• Run by...
• Suite
• Class
• Test
21. TEST NAVIGATOR
• Deep integration
• Click a test name to see the code.
• Test failure breakpoints
• See Bot results in Xcode
22. BOTS
• From Jenkins world? Think of them as very focused jobs.
• One bot configuration
• One branch
• One schedule (daily, hourly, on commit)
• One target
23. BOTS - EXAMPLES
• On commit, make sure project builds with 0 errors, 0
warnings, 0 SA results
• On commit, make sure project builds with 0 test failures.
• Nightly, post a new build and keep it around for posterity
29. CAVEATS
• Submodules must be at HEAD of branch
• Simulator keeps state between build runs
• Make your tests and targets idempotent
• git commit polling sometimes breaks
• HTTP guest login is broken
• No CocoaPods for you
32. DON’T FIGHTTHE FUTURE
“These are all new technologies that are a core
of iOS 7 and had multiple sessions dedicated to
them at Apple’s major developer event. You can
be damn sure that the company is proud of
them, and looking for developers to highlight
who have integrated them into their apps.”
!
- Justin Williams (@justin)
33. ADDITIONAL RESOURCES
• CI Example Project
• With Submodules
• Without Submodules
• http://github.com/koleson/