SlideShare une entreprise Scribd logo
1  sur  65
CI in the Mobile World
Godfrey Nolan
RIIS LLC
godfrey@riis.com
Agenda
• What is CI
• Benefits of CI in Mobile World
• CI Configuration
 • Android
 • iPhone
• Still a work in progress
 • Perfecto Mobile
 • Test Flight App
 • Executable Requirements
Spam #1
• RIIS LLC
 • Based in Southfield, MI
• Mobile Development
 • Fandango
 • DTE Outage Maps
 • BroadSoft Front Office Assistant
• Other Clients
 • BondDesk
 • Comerica
 • BCBSM
Spam #2
What is CI?
• Automate everything
 • Soup to nuts
 • Build, test and deploy
• Build as often as possible
 • Build early, build often
 • Typically on every checkin
 • Alternatively nightly builds
• Practice, practice, practice
What is CI?
• Automate ….
 • Builds
 • Unit testing
 • Functional testing.
 • Mobile Device Testing
 • Code Coverage
 • Deployment
Benefits of CI
• Fewer Errors
 • iPhone vs. Android story
• Faster Feedback
• Repeatable and Reliable
• No more manual testing
 • Cheaper
• Built in regression testing
Benefits of CI in a Mobile World
• Less complex
  • Mobile in its infancy
  • Typically smaller projects and teams
• Lots of CI mobile plugins available
• Easy deployment options
  • Testflight App (iPhone)
  • Email apk (Android)
• Too many Android devices to manually test
  • Automated Device testing is the holy grail
Mobile Device Testing
Goal
Goal
It’s all about your perspective
CI Configuration
                                  Android   IPhone
         Requirement

         CI Server

         Source Code Repository

         Project Build

         Unit Testing

         Functional Testing

         Mobile Device Testing

         Deployment
CI Server
• Jenkins is de-facto industry standard
• Currently the best choice
 • Number of plugins
 • Ease of use
• Good for both Android and iPhone
  apps.
CI Server
• Download from http://jenkins-ci.org/.
• "java -jar jenkins.war" from cmd line
• load Jenkins in browser at
  http://localhost:8080
• RIP Hudson
CI Server
CI Server
• Under Manage Jenkins, Configure System.
 • Add ant, JDK, and android SDK paths
• Under Manage Jenkins, Plugin Manager.
 • Install XCode, GitHub and TestFlight
Requirements for CI
                                 Android   IPhone
        Requirement

        CI Server

        Source Code Repository

        Project Build

        Unit Testing

        Functional Testing

        Mobile Device Testing

        Deployment
Source Code Repository
• Provides
 • Safety
 • Version Control etc.
• Subversion (SVN) or GitHub
 • SVN for the Android project
 • GitHub for iPhone project
Android and iPhone projects
SVN
• Create a new project on your SVN host
SVN
• Using tortoise svn simply right click and say import.
• Note that using the standard trunk tags and
  branches of svn will force you to specify your
  build.xml location in Jenkins because it will not be
  in the project root.
GitHub
• Download Git from github.com
• Create a new ssh key by entering the
  following command
   ssh-keygen –t rsa –C “your-email”
• Enter a passphrase when prompted.
• Click on GitHub.com account settings, SSH
  public keys, and click add a SSH Key.
• Copy the contents of the id_rsa.pub and
  hit add key.
GitHub Cont.
• To create a repository
 • Click create a repository on github.com
 • Fill in the requested fields.
 • git init in source code dir
 • git add (file(s) to be added)
 • git commit –m “message”
 • git push to push to GitHub
Requirements for CI
                                 Android   IPhone
        Requirement

        CI Server

        Source Code Repository

        Project Build

        Unit Testing

        Functional Testing

        Mobile Device Testing

        Deployment
Creating a Android Test Project
• Create a new project AndroidCIDemo and select
  free style project.
Configuring a Android Test
Project
• Enter SVN details
• Jenkins will alert you if it cannot access the URL
• Be sure to enter credentials correctly
Configuring a Android Test Project
Cont.
• Under the Build tab
  • Add commands to build/run the project.
  • Click on Add build step and select Execute shell.
  • Run android update project must be run in order to create the
    local.properties file.
[path_to_android_sdk]/tools/android update project –p
./[path_to_build.xml]
• If android tools is already on your path and the build.xml file is in
    root than the command would be:
Android update project –p ./
• Add another build step Invoke Ant and add the target debug.
• If build.xml file not in root hit advanced and specify its location in
    the build file field.
Build
Now build the project and hopefully it runs with no errors.
Requirements for CI
                                 Android   IPhone
        Requirement

        CI Server

        Source Code Repository

        Project Build

        Unit Testing

        Functional Testing

        Mobile Device Testing

        Deployment
Unit Tests
• For unit tests in Android use built in JUnit framework.
Functional Tests
• For Android Functional tests use Robotium
• To implement Robotium all you have to do is add it to
  your test projects build path.
• GUI based, i.e. brittle
Modifications to the Android Project
• Both Unit and Functional tests are run in the same way.
• To run android tests run an emulator during the build.
• Under build environment choose Run an Android emulator during build.
  If you have already created an emulator using the android avd than you
  can choose to run that here, otherwise choose run emulator with
  properties.
• Specify the OS version, Screen
  density and Screen resolution
• Uncheck the Show emulator
  window box under Common
  emulator options to run headless.
Modifications Cont.
• Add another Execute shell command:
  [path_to_android_sdk]/tools/android update test-project
  –p ./[path_to_test_project] –m ./[path_to_main_project].
• And change the ant target to debug install test (don’t
  forget to change the build file if its not in root).
Requirements for CI
                                 Android   IPhone
        Requirement

        CI Server

        Source Code Repository

        Project Build

        Unit Testing

        Functional Testing

        Mobile Device Testing

        Deployment
Multi Configuration Job
• For multiple device testing create matrix jobs
  • Specify variables to run multi test combinations
  • Run multiple emulators to make sure the app
    behaves same across different devices
Configuration Matrixes
• Create a new project in Jenkins and choose
  matrix configuration job.
• Same setup except we have to add one or more
  configuration matrixes.
Configuration Matrixes Cont.
• Under the Configuration Matrix tab choose add
  axis.
• Jenkins will than ask for a name and values. For
  example you can choose to create an emulator
  for different OS versions and screen density's.
• This matrix runs job on four different emulators.
Configure the Emulator
• Now use variables instead of hard coded values.
Requirements for CI
                                 Android   IPhone
        Requirement

        CI Server

        Source Code Repository

        Project Build

        Unit Testing

        Functional Testing

        Mobile Device Testing

        Deployment
Android Deployment
• Manage Jenkins->manage plugins.
• Download email-extension plugin
Email Configuration
• Go to email notification tab and check the box.
• Choose a recipient, subject, and message. Under
  attachments give it the argument **/*.apk
• Add trigger on success to choose who it’s sent to.
Requirements for CI
                                 Android   IPhone
        Requirement

        CI Server

        Source Code Repository

        Project Build

        Unit Testing

        Functional Testing

        Mobile Device Testing

        Deployment
Creating a iPhone Test Project
• Create a new job IPhoneCIDemo with the option build free
  style
Configuring the IPhone Test
Project
• Go to the source control tab and select GitHub.
• Copy your GitHub into Repository URL field
• Specify a branch if not in the default branch.
Configuring the IPhone Test Project
Cont.
• Go to the build tab and add a new build step
  XCode.
• Change the XCode target to the target you want
  to build, and supply XCode project directory and
  file if not in root.
• Fill in the XCode SDK field and change the
  Configuration field to default or debug.
Requirements for CI
                                 Android   IPhone
        Requirement

        CI Server

        Source Code Repository

        Project Build

        Unit Testing

        Functional Testing

        Mobile Device Testing

        Deployment
iPhone Unit Tests
• Use standard OCunit testing framework.
• Jenkins uses Christian Hedlin’s Ocunit2junit ruby
  script
  • Converts the Xcode OCunit tests to JUnit tests.
  • Cannot run any tests that touch the UI.
Modifications to the IPhone Project
 • Remove test host values under the build settings
 • Add a new build step:
xcodebuild -target yourtarget -configuration Debug -sdk
iphonesdk | [path_to_ruby_script]/ocunit2junit.rb
 • Choose publish junit test results and give it the value test-
   reports/*.xml
Requirements for CI
                                 Android   IPhone
        Requirement

        CI Server

        Source Code Repository

        Project Build

        Unit Testing

        Functional Testing

        Mobile Device Testing

        Deployment
iOS Functional Tests
• Use FoneMonkey to run functional tests from CI.
• Create automated tests by recording
  scripts and adding verification steps
• Brittle GUI testing again 
FoneMonkey
• To implement FoneMonkey first create a new target by
  duplicating the primary target.
• Download the FoneMonkey Zip File and add it to the new
  target
• Under the build phases tab of the FoneMonkey target go to
  the link with binary with libraries tab.
• Click on the + button and add the CoreGraphics.framework
  and QuartzCore.framework.
• You will also need to add the libxml2.dylib and
  SenTestingKit.framework
• Lastly On the Build Settings tab, scroll down to the Linking
  section and set Other Linker Flags to -all_load
FoneMonkey Cont.
• To be able to run FoneMonkey from the command line without having
  to start Xcode we need to create a TestRunner
• Create a new target off of your FoneMonkey target
• Add a run script to the TestRunner target under build phases

export FONEMONKEY_HOME=~/[Location_of_Fone_Monkey]
export FAMILY=[iphone|ipad]
export LOG_FILE="$PROJECT_DIR/$TARGETNAME.log“
export FONEMONKEY_ENV=$FONEMONKEY_HOME/FoneMonkeyRunner.plist rm -f "$LOG_FILE"

$FONEMONKEY_HOME/bin/iphonesim launch "$CODESIGNING_FOLDER_PATH" -verbose -sdk
$IPHONEOS_DEPLOYMENT_TARGET -family $FAMILY -stderr “ $LOG_FILE" -env
"$FONEMONKEY_ENV“


• You can now run this target from the command line and it will run
  your FoneMonkey tests for you.
FoneMonkey
• The command to run the FoneMonkey TestRunner is
  xcodebuild –target TestRunnerTargetName –sdk
iPhonesimulatorsdk –configuration Debug
Requirements for CI
                                 Android   IPhone
        Requirement

        CI Server

        Source Code Repository

        Project Build

        Unit Testing

        Functional Testing

        Mobile Device Testing

        Deployment
iPhone Deployment
• Use Test Flight App
• Over the air beta testing
• Test Flight app Jenkins plugin doesn’t work
• But…all is not lost
  • Add a new build step and choose Xcode
  • Fill in the normal fields and choose to build IPA
    and unlock keychain as well.
  • Add keychain password.
iPhone Deployment
 • Add a build step execute shell and add the following
   commands:

cd $WORKSPACE/build/Release-iphoneos/ curl
http://testflightapp.com/api/builds.json-F file=@[IPA_FILE_NAME] -F
api_token='[API_TOKEN]' -F team_token='[TEAM_TOKEN]' -F
notes='This is an auto deploy build from Jenkins!' -F notify=True -F
distribution_lists='[DISTRIBUTION_LIST]


• Team token and api token can be gotten from your
  testflight account
Requirements for CI
                                 Android   IPhone
        Requirement

        CI Server

        Source Code Repository

        Project Build

        Unit Testing

        Functional Testing

        Mobile Device Testing

        Deployment
Conclusion
• Work in Progress
 • Executable Requirements
 • Perfecto Mobile
 • Test Flight App
• Demo
• Followup
 • github.com/RIIS/RIIS-codemash.git
 • godfrey@riis.com
 • Android Application Testing Guide
Thanks
• RIIS
  • Derek Verlee
  • David Armstrong
  • Brad Dunlap
• Nayan Hajratwala

Contenu connexe

Tendances

Marrying Jenkins and Gerrit-Berlin Expert Days 2013
Marrying Jenkins and Gerrit-Berlin Expert Days 2013Marrying Jenkins and Gerrit-Berlin Expert Days 2013
Marrying Jenkins and Gerrit-Berlin Expert Days 2013
Dharmesh Sheta
 

Tendances (20)

Tizen Native Application Development with C/C++
Tizen Native Application Development with C/C++Tizen Native Application Development with C/C++
Tizen Native Application Development with C/C++
 
Alliance Successful Selenium Automation
Alliance Successful Selenium AutomationAlliance Successful Selenium Automation
Alliance Successful Selenium Automation
 
TMF2014 CI-CD Workshop Michael Palotas
TMF2014 CI-CD Workshop Michael PalotasTMF2014 CI-CD Workshop Michael Palotas
TMF2014 CI-CD Workshop Michael Palotas
 
Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?
 
Jumping from Continuous Integration to Continuous Delivery with Jenkins Enter...
Jumping from Continuous Integration to Continuous Delivery with Jenkins Enter...Jumping from Continuous Integration to Continuous Delivery with Jenkins Enter...
Jumping from Continuous Integration to Continuous Delivery with Jenkins Enter...
 
Adapting Deployment Pipelines for Complex Applications
Adapting Deployment Pipelines for Complex ApplicationsAdapting Deployment Pipelines for Complex Applications
Adapting Deployment Pipelines for Complex Applications
 
Marrying Jenkins and Gerrit-Berlin Expert Days 2013
Marrying Jenkins and Gerrit-Berlin Expert Days 2013Marrying Jenkins and Gerrit-Berlin Expert Days 2013
Marrying Jenkins and Gerrit-Berlin Expert Days 2013
 
Quality in dev ops east 2017
Quality in dev ops east 2017Quality in dev ops east 2017
Quality in dev ops east 2017
 
Agile Bodensee - Testautomation & Continuous Delivery Workshop
Agile Bodensee - Testautomation & Continuous Delivery WorkshopAgile Bodensee - Testautomation & Continuous Delivery Workshop
Agile Bodensee - Testautomation & Continuous Delivery Workshop
 
Building a CICD pipeline for deploying to containers
Building a CICD pipeline for deploying to containersBuilding a CICD pipeline for deploying to containers
Building a CICD pipeline for deploying to containers
 
Build Time Hacking
Build Time HackingBuild Time Hacking
Build Time Hacking
 
The Next Generation of Continuous Delivery
The Next Generation of Continuous DeliveryThe Next Generation of Continuous Delivery
The Next Generation of Continuous Delivery
 
codEnforcer 2013
codEnforcer 2013codEnforcer 2013
codEnforcer 2013
 
Vijay_Teekinavar_Kallesh
Vijay_Teekinavar_KalleshVijay_Teekinavar_Kallesh
Vijay_Teekinavar_Kallesh
 
2012 01-jenkins-udeploy
2012 01-jenkins-udeploy2012 01-jenkins-udeploy
2012 01-jenkins-udeploy
 
Open Source Compliance for DevOps - OSCON 2017
Open Source Compliance for DevOps - OSCON 2017Open Source Compliance for DevOps - OSCON 2017
Open Source Compliance for DevOps - OSCON 2017
 
NCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile AppsNCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile Apps
 
Scaling Continuous Integration Practices to Teams with Parallel Development
Scaling Continuous Integration Practices to Teams with Parallel DevelopmentScaling Continuous Integration Practices to Teams with Parallel Development
Scaling Continuous Integration Practices to Teams with Parallel Development
 
How to Reliably Measure and Optimize Graphics Performance of Your Android Games
How to Reliably Measure and Optimize Graphics Performance of Your Android GamesHow to Reliably Measure and Optimize Graphics Performance of Your Android Games
How to Reliably Measure and Optimize Graphics Performance of Your Android Games
 
Samsung Indonesia: Tizen Web Apps
Samsung Indonesia: Tizen Web AppsSamsung Indonesia: Tizen Web Apps
Samsung Indonesia: Tizen Web Apps
 

En vedette

Yale Jenkins Show and Tell
Yale Jenkins Show and TellYale Jenkins Show and Tell
Yale Jenkins Show and Tell
E. Camden Fisher
 

En vedette (11)

Enterprise level cloud CI
Enterprise level cloud CIEnterprise level cloud CI
Enterprise level cloud CI
 
Ci tools Introduce
Ci tools IntroduceCi tools Introduce
Ci tools Introduce
 
Fast deterministic screenshot tests for Android
Fast deterministic screenshot tests for AndroidFast deterministic screenshot tests for Android
Fast deterministic screenshot tests for Android
 
Core Principles Of Ci
Core Principles Of CiCore Principles Of Ci
Core Principles Of Ci
 
Tips for better CI on Android
Tips for better CI on AndroidTips for better CI on Android
Tips for better CI on Android
 
Continuous Integration, the minimum viable product
Continuous Integration, the minimum viable productContinuous Integration, the minimum viable product
Continuous Integration, the minimum viable product
 
Screenshots Test spoon + espresso
Screenshots Test spoon + espressoScreenshots Test spoon + espresso
Screenshots Test spoon + espresso
 
Jenkins-CI
Jenkins-CIJenkins-CI
Jenkins-CI
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 
Yale Jenkins Show and Tell
Yale Jenkins Show and TellYale Jenkins Show and Tell
Yale Jenkins Show and Tell
 
CI and CD with Jenkins
CI and CD with JenkinsCI and CD with Jenkins
CI and CD with Jenkins
 

Similaire à CI in the mobile world

Codestrong 2012 breakout session how to develop your own modules
Codestrong 2012 breakout session   how to develop your own modulesCodestrong 2012 breakout session   how to develop your own modules
Codestrong 2012 breakout session how to develop your own modules
Axway Appcelerator
 

Similaire à CI in the mobile world (20)

Ciprian redinciuc continuous integration with jenkins for i os
Ciprian redinciuc   continuous integration with jenkins for i osCiprian redinciuc   continuous integration with jenkins for i os
Ciprian redinciuc continuous integration with jenkins for i os
 
Codestrong 2012 breakout session how to develop your own modules
Codestrong 2012 breakout session   how to develop your own modulesCodestrong 2012 breakout session   how to develop your own modules
Codestrong 2012 breakout session how to develop your own modules
 
Introduction to Module Development with Appcelerator Titanium
Introduction to Module Development with Appcelerator TitaniumIntroduction to Module Development with Appcelerator Titanium
Introduction to Module Development with Appcelerator Titanium
 
Application Lifecycle Management
Application Lifecycle ManagementApplication Lifecycle Management
Application Lifecycle Management
 
Continuos integration with Jenkins for iOS | SuperSpeakers@CodeCamp Iasi, 2014
Continuos integration with Jenkins for iOS | SuperSpeakers@CodeCamp Iasi, 2014Continuos integration with Jenkins for iOS | SuperSpeakers@CodeCamp Iasi, 2014
Continuos integration with Jenkins for iOS | SuperSpeakers@CodeCamp Iasi, 2014
 
Announcing AWS CodeBuild - January 2017 Online Teck Talks
Announcing AWS CodeBuild - January 2017 Online Teck TalksAnnouncing AWS CodeBuild - January 2017 Online Teck Talks
Announcing AWS CodeBuild - January 2017 Online Teck Talks
 
Testing on Android
Testing on AndroidTesting on Android
Testing on Android
 
ACDKOCHI19 - CI / CD using AWS Developer Tools
ACDKOCHI19 - CI / CD using AWS Developer ToolsACDKOCHI19 - CI / CD using AWS Developer Tools
ACDKOCHI19 - CI / CD using AWS Developer Tools
 
Xamarin v.Now
Xamarin v.NowXamarin v.Now
Xamarin v.Now
 
SRV312 DevOps on AWS: Building Systems to Deliver Faster
SRV312 DevOps on AWS: Building Systems to Deliver FasterSRV312 DevOps on AWS: Building Systems to Deliver Faster
SRV312 DevOps on AWS: Building Systems to Deliver Faster
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
 
Continuous Integration for your Android projects
Continuous Integration for your Android projectsContinuous Integration for your Android projects
Continuous Integration for your Android projects
 
Jenkins_1679702972.pdf
Jenkins_1679702972.pdfJenkins_1679702972.pdf
Jenkins_1679702972.pdf
 
jenkins.pdf
jenkins.pdfjenkins.pdf
jenkins.pdf
 
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer ToolsA Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
 
DevOps on AWS: DevOps Day San Francisco
DevOps on AWS: DevOps Day San FranciscoDevOps on AWS: DevOps Day San Francisco
DevOps on AWS: DevOps Day San Francisco
 
ENT201 A Tale of Two Pizzas: Accelerating Software Delivery with AWS Develope...
ENT201 A Tale of Two Pizzas: Accelerating Software Delivery with AWS Develope...ENT201 A Tale of Two Pizzas: Accelerating Software Delivery with AWS Develope...
ENT201 A Tale of Two Pizzas: Accelerating Software Delivery with AWS Develope...
 
Developer Tools at AWS 2018.pdf
Developer Tools at AWS 2018.pdfDeveloper Tools at AWS 2018.pdf
Developer Tools at AWS 2018.pdf
 
Android class provider in mumbai
Android class provider in mumbaiAndroid class provider in mumbai
Android class provider in mumbai
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
 

Plus de Godfrey Nolan

Plus de Godfrey Nolan (20)

Counting Cars with Drones
Counting Cars with DronesCounting Cars with Drones
Counting Cars with Drones
 
Customising QGroundControl
Customising QGroundControlCustomising QGroundControl
Customising QGroundControl
 
DJI Payload SDK
DJI Payload SDKDJI Payload SDK
DJI Payload SDK
 
Parrot Tutorials in Kotlin
Parrot Tutorials in KotlinParrot Tutorials in Kotlin
Parrot Tutorials in Kotlin
 
DJI Mobile SDK Tutorials in kotlin
DJI Mobile SDK Tutorials in kotlinDJI Mobile SDK Tutorials in kotlin
DJI Mobile SDK Tutorials in kotlin
 
Drone sdk showdown
Drone sdk showdownDrone sdk showdown
Drone sdk showdown
 
AI/ML in drones
AI/ML in dronesAI/ML in drones
AI/ML in drones
 
Getting started with tensor flow datasets
Getting started with tensor flow datasets Getting started with tensor flow datasets
Getting started with tensor flow datasets
 
Using ML to make your UI tests more robust
Using ML to make your UI tests more robustUsing ML to make your UI tests more robust
Using ML to make your UI tests more robust
 
Java best practices
Java best practicesJava best practices
Java best practices
 
Counting sheep with Drones and AI
Counting sheep with Drones and AICounting sheep with Drones and AI
Counting sheep with Drones and AI
 
Writing Secure Mobile Apps for Drones
Writing Secure Mobile Apps for DronesWriting Secure Mobile Apps for Drones
Writing Secure Mobile Apps for Drones
 
Android Device Labs
Android Device LabsAndroid Device Labs
Android Device Labs
 
The Day We Infected Ourselves with Ransomware
The Day We Infected Ourselves with RansomwareThe Day We Infected Ourselves with Ransomware
The Day We Infected Ourselves with Ransomware
 
Agile Android
Agile AndroidAgile Android
Agile Android
 
Agile Swift
Agile SwiftAgile Swift
Agile Swift
 
Android Refactoring
Android RefactoringAndroid Refactoring
Android Refactoring
 
Agile mobile
Agile mobileAgile mobile
Agile mobile
 
From Maps to Apps the Future of Drone Technology
From Maps to Apps the Future of Drone TechnologyFrom Maps to Apps the Future of Drone Technology
From Maps to Apps the Future of Drone Technology
 
Tableau 10 and quickbooks
Tableau 10 and quickbooksTableau 10 and quickbooks
Tableau 10 and quickbooks
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

CI in the mobile world

  • 1. CI in the Mobile World Godfrey Nolan RIIS LLC godfrey@riis.com
  • 2. Agenda • What is CI • Benefits of CI in Mobile World • CI Configuration • Android • iPhone • Still a work in progress • Perfecto Mobile • Test Flight App • Executable Requirements
  • 3. Spam #1 • RIIS LLC • Based in Southfield, MI • Mobile Development • Fandango • DTE Outage Maps • BroadSoft Front Office Assistant • Other Clients • BondDesk • Comerica • BCBSM
  • 5. What is CI? • Automate everything • Soup to nuts • Build, test and deploy • Build as often as possible • Build early, build often • Typically on every checkin • Alternatively nightly builds • Practice, practice, practice
  • 6. What is CI? • Automate …. • Builds • Unit testing • Functional testing. • Mobile Device Testing • Code Coverage • Deployment
  • 7. Benefits of CI • Fewer Errors • iPhone vs. Android story • Faster Feedback • Repeatable and Reliable • No more manual testing • Cheaper • Built in regression testing
  • 8. Benefits of CI in a Mobile World • Less complex • Mobile in its infancy • Typically smaller projects and teams • Lots of CI mobile plugins available • Easy deployment options • Testflight App (iPhone) • Email apk (Android) • Too many Android devices to manually test • Automated Device testing is the holy grail
  • 10. Goal
  • 11. Goal
  • 12. It’s all about your perspective
  • 13. CI Configuration Android IPhone Requirement CI Server Source Code Repository Project Build Unit Testing Functional Testing Mobile Device Testing Deployment
  • 14. CI Server • Jenkins is de-facto industry standard • Currently the best choice • Number of plugins • Ease of use • Good for both Android and iPhone apps.
  • 15. CI Server • Download from http://jenkins-ci.org/. • "java -jar jenkins.war" from cmd line • load Jenkins in browser at http://localhost:8080 • RIP Hudson
  • 17. CI Server • Under Manage Jenkins, Configure System. • Add ant, JDK, and android SDK paths • Under Manage Jenkins, Plugin Manager. • Install XCode, GitHub and TestFlight
  • 18.
  • 19.
  • 20. Requirements for CI Android IPhone Requirement CI Server Source Code Repository Project Build Unit Testing Functional Testing Mobile Device Testing Deployment
  • 21. Source Code Repository • Provides • Safety • Version Control etc. • Subversion (SVN) or GitHub • SVN for the Android project • GitHub for iPhone project
  • 22. Android and iPhone projects
  • 23. SVN • Create a new project on your SVN host
  • 24. SVN • Using tortoise svn simply right click and say import. • Note that using the standard trunk tags and branches of svn will force you to specify your build.xml location in Jenkins because it will not be in the project root.
  • 25. GitHub • Download Git from github.com • Create a new ssh key by entering the following command ssh-keygen –t rsa –C “your-email” • Enter a passphrase when prompted. • Click on GitHub.com account settings, SSH public keys, and click add a SSH Key. • Copy the contents of the id_rsa.pub and hit add key.
  • 26.
  • 27. GitHub Cont. • To create a repository • Click create a repository on github.com • Fill in the requested fields. • git init in source code dir • git add (file(s) to be added) • git commit –m “message” • git push to push to GitHub
  • 28. Requirements for CI Android IPhone Requirement CI Server Source Code Repository Project Build Unit Testing Functional Testing Mobile Device Testing Deployment
  • 29. Creating a Android Test Project • Create a new project AndroidCIDemo and select free style project.
  • 30. Configuring a Android Test Project • Enter SVN details • Jenkins will alert you if it cannot access the URL • Be sure to enter credentials correctly
  • 31. Configuring a Android Test Project Cont. • Under the Build tab • Add commands to build/run the project. • Click on Add build step and select Execute shell. • Run android update project must be run in order to create the local.properties file. [path_to_android_sdk]/tools/android update project –p ./[path_to_build.xml] • If android tools is already on your path and the build.xml file is in root than the command would be: Android update project –p ./ • Add another build step Invoke Ant and add the target debug. • If build.xml file not in root hit advanced and specify its location in the build file field.
  • 32.
  • 33. Build Now build the project and hopefully it runs with no errors.
  • 34. Requirements for CI Android IPhone Requirement CI Server Source Code Repository Project Build Unit Testing Functional Testing Mobile Device Testing Deployment
  • 35. Unit Tests • For unit tests in Android use built in JUnit framework.
  • 36. Functional Tests • For Android Functional tests use Robotium • To implement Robotium all you have to do is add it to your test projects build path. • GUI based, i.e. brittle
  • 37. Modifications to the Android Project • Both Unit and Functional tests are run in the same way. • To run android tests run an emulator during the build. • Under build environment choose Run an Android emulator during build. If you have already created an emulator using the android avd than you can choose to run that here, otherwise choose run emulator with properties. • Specify the OS version, Screen density and Screen resolution • Uncheck the Show emulator window box under Common emulator options to run headless.
  • 38. Modifications Cont. • Add another Execute shell command: [path_to_android_sdk]/tools/android update test-project –p ./[path_to_test_project] –m ./[path_to_main_project]. • And change the ant target to debug install test (don’t forget to change the build file if its not in root).
  • 39. Requirements for CI Android IPhone Requirement CI Server Source Code Repository Project Build Unit Testing Functional Testing Mobile Device Testing Deployment
  • 40. Multi Configuration Job • For multiple device testing create matrix jobs • Specify variables to run multi test combinations • Run multiple emulators to make sure the app behaves same across different devices
  • 41. Configuration Matrixes • Create a new project in Jenkins and choose matrix configuration job. • Same setup except we have to add one or more configuration matrixes.
  • 42. Configuration Matrixes Cont. • Under the Configuration Matrix tab choose add axis. • Jenkins will than ask for a name and values. For example you can choose to create an emulator for different OS versions and screen density's. • This matrix runs job on four different emulators.
  • 43. Configure the Emulator • Now use variables instead of hard coded values.
  • 44. Requirements for CI Android IPhone Requirement CI Server Source Code Repository Project Build Unit Testing Functional Testing Mobile Device Testing Deployment
  • 45. Android Deployment • Manage Jenkins->manage plugins. • Download email-extension plugin
  • 46. Email Configuration • Go to email notification tab and check the box. • Choose a recipient, subject, and message. Under attachments give it the argument **/*.apk • Add trigger on success to choose who it’s sent to.
  • 47. Requirements for CI Android IPhone Requirement CI Server Source Code Repository Project Build Unit Testing Functional Testing Mobile Device Testing Deployment
  • 48. Creating a iPhone Test Project • Create a new job IPhoneCIDemo with the option build free style
  • 49. Configuring the IPhone Test Project • Go to the source control tab and select GitHub. • Copy your GitHub into Repository URL field • Specify a branch if not in the default branch.
  • 50. Configuring the IPhone Test Project Cont. • Go to the build tab and add a new build step XCode. • Change the XCode target to the target you want to build, and supply XCode project directory and file if not in root. • Fill in the XCode SDK field and change the Configuration field to default or debug.
  • 51.
  • 52. Requirements for CI Android IPhone Requirement CI Server Source Code Repository Project Build Unit Testing Functional Testing Mobile Device Testing Deployment
  • 53. iPhone Unit Tests • Use standard OCunit testing framework. • Jenkins uses Christian Hedlin’s Ocunit2junit ruby script • Converts the Xcode OCunit tests to JUnit tests. • Cannot run any tests that touch the UI.
  • 54. Modifications to the IPhone Project • Remove test host values under the build settings • Add a new build step: xcodebuild -target yourtarget -configuration Debug -sdk iphonesdk | [path_to_ruby_script]/ocunit2junit.rb • Choose publish junit test results and give it the value test- reports/*.xml
  • 55. Requirements for CI Android IPhone Requirement CI Server Source Code Repository Project Build Unit Testing Functional Testing Mobile Device Testing Deployment
  • 56. iOS Functional Tests • Use FoneMonkey to run functional tests from CI. • Create automated tests by recording scripts and adding verification steps • Brittle GUI testing again 
  • 57. FoneMonkey • To implement FoneMonkey first create a new target by duplicating the primary target. • Download the FoneMonkey Zip File and add it to the new target • Under the build phases tab of the FoneMonkey target go to the link with binary with libraries tab. • Click on the + button and add the CoreGraphics.framework and QuartzCore.framework. • You will also need to add the libxml2.dylib and SenTestingKit.framework • Lastly On the Build Settings tab, scroll down to the Linking section and set Other Linker Flags to -all_load
  • 58. FoneMonkey Cont. • To be able to run FoneMonkey from the command line without having to start Xcode we need to create a TestRunner • Create a new target off of your FoneMonkey target • Add a run script to the TestRunner target under build phases export FONEMONKEY_HOME=~/[Location_of_Fone_Monkey] export FAMILY=[iphone|ipad] export LOG_FILE="$PROJECT_DIR/$TARGETNAME.log“ export FONEMONKEY_ENV=$FONEMONKEY_HOME/FoneMonkeyRunner.plist rm -f "$LOG_FILE" $FONEMONKEY_HOME/bin/iphonesim launch "$CODESIGNING_FOLDER_PATH" -verbose -sdk $IPHONEOS_DEPLOYMENT_TARGET -family $FAMILY -stderr “ $LOG_FILE" -env "$FONEMONKEY_ENV“ • You can now run this target from the command line and it will run your FoneMonkey tests for you.
  • 59. FoneMonkey • The command to run the FoneMonkey TestRunner is xcodebuild –target TestRunnerTargetName –sdk iPhonesimulatorsdk –configuration Debug
  • 60. Requirements for CI Android IPhone Requirement CI Server Source Code Repository Project Build Unit Testing Functional Testing Mobile Device Testing Deployment
  • 61. iPhone Deployment • Use Test Flight App • Over the air beta testing • Test Flight app Jenkins plugin doesn’t work • But…all is not lost • Add a new build step and choose Xcode • Fill in the normal fields and choose to build IPA and unlock keychain as well. • Add keychain password.
  • 62. iPhone Deployment • Add a build step execute shell and add the following commands: cd $WORKSPACE/build/Release-iphoneos/ curl http://testflightapp.com/api/builds.json-F file=@[IPA_FILE_NAME] -F api_token='[API_TOKEN]' -F team_token='[TEAM_TOKEN]' -F notes='This is an auto deploy build from Jenkins!' -F notify=True -F distribution_lists='[DISTRIBUTION_LIST] • Team token and api token can be gotten from your testflight account
  • 63. Requirements for CI Android IPhone Requirement CI Server Source Code Repository Project Build Unit Testing Functional Testing Mobile Device Testing Deployment
  • 64. Conclusion • Work in Progress • Executable Requirements • Perfecto Mobile • Test Flight App • Demo • Followup • github.com/RIIS/RIIS-codemash.git • godfrey@riis.com • Android Application Testing Guide
  • 65. Thanks • RIIS • Derek Verlee • David Armstrong • Brad Dunlap • Nayan Hajratwala

Notes de l'éditeur

  1. DTE Outage Map and BroadSoft Front Office Assistant for setting up your office PBX
  2. Cron jobs look to see what’s been checked in and runs tests
  3. Perfecto Mobile
  4. Goal is to jump start your CI efforts for your mobile projectsDownload presentation for Jenkins configuration information from github
  5. This is not a TDD or BDD talk, there is no code, this is a jenkins configuration talk
  6. As a business owner my perspective is happy customers, low defects, informed customers. CONSISTENT PROCESSES, how do you not sell it to your customers??
  7. Give overview of what we’re trying to do
  8. Dreamhost
  9. Explain build.xml snafu
  10. Executable tests not yet there for Android
  11. Test flight app on iphone much nicer
  12. Jenkins currently does not understand the standard OCunit framework.