CONTINUOUS
INTEGRATION
FROM UNIT TESTS
TO HARDWARE
Rémy Virin
Cocoaheads
@remyvirin
WHO AM I ? LIMA ?
• I’m an iOS software engineer at Forget box.
• We’re creating a new way to store your data.
• Backed on...
BEFORE, 10 YEARS AGO

One User

One device

One Memory
TODAY, MULTIPLE DEVICES,
MULTIPLE MEMORIES

One User

Multiple devices

Divided memories
TODAY, CLOUD SOLUTION IS
JUST A PATCH

One User

Multiple devices

Divided memories
TODAY, CLOUD SOLUTION IS
JUST A PATCH

One User

One Unified Memory
CONTINUOUS
INTEGRATION
FROM UNIT TESTS
TO HARDWARE
WHY ?
SHIP, SHIP, SHIIIIP
SHIP, SHIP, SHIIIIP !!!
!!!
MEASURE QUALITY
• Photo quality
HOW ?
C.I. BASICS
Execute unit
tests
Publish app to
mktg
Continuous
Integration

Fetch sources

Generate
Documentatio
n

Worksta...
SAS vs LOCAL
JENKINS
ABOUT JENKINS
• Open Source

• Easy to install
• Best known CI solution
INSTALL JENKINS
ADD PLUGINS
ADD PLUGINS
CREATE A JOB

CREATE A JOB
CREATE A JOB
• Set up Github url and restrict where the job should be run if your
mac is a node of Jenkins.
CREATE A JOB WITH
PLUGINS
CREATE A JOB WITH A
SCRIPT
Build your project, run Unit Tests, compute code coverage, package
your app, deploy it etc…
$ p...
PLUGINS vs SCRIPTS
Most of the time, plugins are easier to
use. Sometimes we don’t have other
choices to use plugins

Exam...
THAT’S IT, YOU CAN ENJOY
NOW…
AND ONE DAY, THE BUILD
FAIL !
WE NEED TO KNOW WHEN
BUILD FAILED
• Basic Alert : Email
• Growl Notification : Hudson-on-cocoa

• Or you can connect Jenki...
YOU’LL NEVER BROKE THE
BUILD AGAIN !

Code source : https://github.com/codedance/Retaliation
BOTS ON iOS
SETUP - REQUIREMENTS

• A mac (at least 10.9)
• OS X Server
• Xcode
SETUP
• Install OS X Server and Xcode on your
mac
• Activate Xcode as a service of your server
• Connect to remote reposit...
ERRORS DURING SETUP
• Error on getting source code -> no error,
big logs for nothing
• Add _teamserver public key to your ...
ERRORS DURING SETUP
• CodeSign error: code signing is required
for product type 'Application' in SDK 'iOS
7.0’  just tryi...
SETUP
• If you have to install your pods before
building your app :
• $ sudo visudo -f /etc/sudoers
• Add this line :
# Sa...
• v

Source : Cocoapods mailing list
PODS IN XCODE
•
PODS IN XCODE
•
COOL THINGS ON BOTS
• Bots Can be created and monitored from
Xcode.
• Integrate with Xcode
• UI and UX rocks.
BAD THINGS ON BOTS
• Lots of bugs
• Fetching pods before building app is painfull
• No 3rd party integration (Testflight, ...
SONAR
An open source platform for
Continuous Inspection of code
quality
SONARQUBE
•
SONARQUBE
• Issues with OCLint are powerfull
• Generate Documentation, Count lines of
code, analyze code duplication and r...
NEXT STEP : HARDWARE
NEXT STEP : HARDWARE
CONCLUSION
IMPROVEMENTS

• « Thanks to Jenkins I’m able
to test the last version of our
app just by pressing a button,
it’s awesome !...
IMPROVEMENTS

• « Each day at 4pm, we get a
new build of our app, it’s really
efficient to reduce the amount
of bugs » Tes...
COST : 8 to 10 % of the project
THANKS !
Continuous integration by Rémy Virin
Upcoming SlideShare
Loading in …5
×

Continuous integration by Rémy Virin

3,768 views

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,768
On SlideShare
0
From Embeds
0
Number of Embeds
3,041
Actions
Shares
0
Downloads
10
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Continuous integration by Rémy Virin

  1. 1. CONTINUOUS INTEGRATION FROM UNIT TESTS TO HARDWARE Rémy Virin Cocoaheads @remyvirin
  2. 2. WHO AM I ? LIMA ? • I’m an iOS software engineer at Forget box. • We’re creating a new way to store your data. • Backed on kickstarter • 12,8K backers • $ 1,2 Millions
  3. 3. BEFORE, 10 YEARS AGO One User One device One Memory
  4. 4. TODAY, MULTIPLE DEVICES, MULTIPLE MEMORIES One User Multiple devices Divided memories
  5. 5. TODAY, CLOUD SOLUTION IS JUST A PATCH One User Multiple devices Divided memories
  6. 6. TODAY, CLOUD SOLUTION IS JUST A PATCH One User One Unified Memory
  7. 7. CONTINUOUS INTEGRATION FROM UNIT TESTS TO HARDWARE
  8. 8. WHY ?
  9. 9. SHIP, SHIP, SHIIIIP SHIP, SHIP, SHIIIIP !!! !!!
  10. 10. MEASURE QUALITY • Photo quality
  11. 11. HOW ?
  12. 12. C.I. BASICS Execute unit tests Publish app to mktg Continuous Integration Fetch sources Generate Documentatio n Workstations Generate metrics Execute functional tests
  13. 13. SAS vs LOCAL
  14. 14. JENKINS
  15. 15. ABOUT JENKINS • Open Source • Easy to install • Best known CI solution
  16. 16. INSTALL JENKINS
  17. 17. ADD PLUGINS
  18. 18. ADD PLUGINS
  19. 19. CREATE A JOB CREATE A JOB
  20. 20. CREATE A JOB • Set up Github url and restrict where the job should be run if your mac is a node of Jenkins.
  21. 21. CREATE A JOB WITH PLUGINS
  22. 22. CREATE A JOB WITH A SCRIPT Build your project, run Unit Tests, compute code coverage, package your app, deploy it etc… $ pod install $ xcodebuild -workspace Lima.xcworkspace -scheme "Lima" -destination=build -configuration Debug_deploy -sdk iphoneos7.0 ONLY_ACTIVE_ARCH=YES clean build archive $ xcodebuild -exportArchive -exportFormat "IPA" archivePath "$NEW_ARCHIVE" -exportPath ./Lima.ipa exportProvisioningProfile "Lima Adhoc Distribution" # And then upload to testflight via curl Full script here: https://gist.github.com/rvirin/7796647
  23. 23. PLUGINS vs SCRIPTS Most of the time, plugins are easier to use. Sometimes we don’t have other choices to use plugins Examples : • cocoapods plugin if podFile is not in root folder • run Unit tests with Xcode plugin
  24. 24. THAT’S IT, YOU CAN ENJOY NOW…
  25. 25. AND ONE DAY, THE BUILD FAIL !
  26. 26. WE NEED TO KNOW WHEN BUILD FAILED • Basic Alert : Email • Growl Notification : Hudson-on-cocoa • Or you can connect Jenkins to your real life…
  27. 27. YOU’LL NEVER BROKE THE BUILD AGAIN ! Code source : https://github.com/codedance/Retaliation
  28. 28. BOTS ON iOS
  29. 29. SETUP - REQUIREMENTS • A mac (at least 10.9) • OS X Server • Xcode
  30. 30. SETUP • Install OS X Server and Xcode on your mac • Activate Xcode as a service of your server • Connect to remote repository • Create your first bot
  31. 31. ERRORS DURING SETUP • Error on getting source code -> no error, big logs for nothing • Add _teamserver public key to your Github repository (deploy keys)
  32. 32. ERRORS DURING SETUP • CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 7.0’  just trying to build the app ! •  Get your provisionning profile on the mac server (Add your account to Xcode)
  33. 33. SETUP • If you have to install your pods before building your app : • $ sudo visudo -f /etc/sudoers • Add this line : # Same thing without a password # %wheel ALL=(ALL) NOPASSWD: ALL %_teamsserver ALL=(ALL) NOPASSWD: ALL
  34. 34. • v Source : Cocoapods mailing list
  35. 35. PODS IN XCODE •
  36. 36. PODS IN XCODE •
  37. 37. COOL THINGS ON BOTS • Bots Can be created and monitored from Xcode. • Integrate with Xcode • UI and UX rocks.
  38. 38. BAD THINGS ON BOTS • Lots of bugs • Fetching pods before building app is painfull • No 3rd party integration (Testflight, hockeyapp etc…) • Can’t Archive an app • Need to create a specific scheme
  39. 39. SONAR An open source platform for Continuous Inspection of code quality
  40. 40. SONARQUBE •
  41. 41. SONARQUBE • Issues with OCLint are powerfull • Generate Documentation, Count lines of code, analyze code duplication and run Unit Tests ! • https://github.com/octo-technology/sonarobjective-c
  42. 42. NEXT STEP : HARDWARE NEXT STEP : HARDWARE
  43. 43. CONCLUSION
  44. 44. IMPROVEMENTS • « Thanks to Jenkins I’m able to test the last version of our app just by pressing a button, it’s awesome ! » Alex Product Guy at Lima
  45. 45. IMPROVEMENTS • « Each day at 4pm, we get a new build of our app, it’s really efficient to reduce the amount of bugs » Tester at Meetic (Dating website)
  46. 46. COST : 8 to 10 % of the project
  47. 47. THANKS !

×