SlideShare ist ein Scribd-Unternehmen logo
1 von 52
Downloaden Sie, um offline zu lesen
Remote iOS Device Server
Scaling iOS testing
Nikolai Abalov
Hello, my name is
Nikolai Abalov
Senior Automation Engineer at Badoo
Previously Senior Developer and Automation Engineer
at 2GIS for 3 years
Co-creator of Winium.Mobile
From Siberia
github.com/NickAb
@NickAb
Agenda
1. Introduction
2. Parallel tests on iOS
3. Device Server
4. Results & next steps
5. Know-Hows — how to apply it at your scale
6. Recap
3
Introduction
4
What we had
● 10 Pull Requests per day to the app repo
● 1200+ end-to-end tests
● 35+ hours of cpu-time
● 1.5 hours wall-clock time
● 1500+ cpu-time hours per day
● Extra projects on the same infrastructure
● Tightly coupled tests and infrastructure
5
What we want
● People trusting the automation
● Fast and reliable feedback
6
What we want
● 30 minutes wall-clock
● Stability
● Scalability
● Easy maintenance and development
7
How to get there
● Delete ⅔ of tests
8
Questions?
Joking aside
● Filter tests based on change set, coverage, components
● Speed up and stabilise tests
● Heavily parallelise test runs
● Provide scalable infrastructure to run tests
10
Parallel tests on iOS
11
Test parallelisation
1200 tests
∕ 1 simulator
= 40 hours
1200 tests
∕ X simulators
= 0.5 hours
X = 80 simulators
12
Options
● 3rd
party cloud
● SauceLabs / TestObject
● Xamarin Test Cloud
● AWS Device Farm
● In-house
13
Multiple users, simulator per user
Agent
Rake / Parallel Cucumber
ssh qa1@h1 ssh qa2@h1 ssh qa1@h2 ssh qa2@h2
macOS,
Xcode,
Ruby,
…
14
Test Test Test Test
iOS Calabash in parallel on one host by Tim Baverstock
Single user, multiple simulators
Agent
Rake / Parallel Cucumber
ssh qa@h1 ssh qa@h1 ssh qa@h2 ssh qa@h2
15
Test Test Test Test Test Test
iOS Parallel Automation: run faster than fast by Viktar Karanevich
Turning iOS End to End Testing up to 11 by Lawrence Lomax
macOS,
Xcode,
Ruby,
…
Issues with current model
● Tight coupling of test code and infrastructure
● Hard to scale
● No sharing of resources between test jobs on CI
● Tests are bound to simulator host machine
● Too easy to mess with simulator internals
16
New Model
17
New model
Not bound
to macOS
18
Device Server
Agent
Rake / Parallel Cucumber
http
Test Test Test Test Test Test
http http http http http
New model
Device Server
ssh ssh ssh ssh
macOS,
Xcode, …
19
Agent
Rake / Parallel Cucumber
Not bound
to macOS
http
Test Test Test Test Test Test
http http http http http
ssh ssh
New model
● Separation of concerns
● Well-defined interface
● Cheaper test environments
● Easy sharing of resources between test jobs on CI
20
Why move? Sharing
t Agent 1 Simulators Agent 2 Simulators
1
2
3
4
5
6
t Shared Simulators
1
2
3
4
21
before after
More reasons to move
● Black boxing
● Easier updates
● No more xcrun simctl, fbsimctl, idevice*
● No more messing with internals
22
● Did not fit well with existing code
● We need custom actions
● We need flexibility and fast prototyping
Why not Selenium Grid?
23
Device Server
24
Tools we were using before
● xcrun simctl
● fbsimctl
● WebDriverAgent
● ideviceinstaller
25
Tools we use now
● fbsimctl
● WebDriverAgent
26
fbsimctl as a server
$ fbsimctl boot -- listen --http 9999 -- shutdown
listen started: Http: 9999 Hid: No stdin: false
GET: /5C34FF6A-4585-406A-A14F-4C0881B74110/list
$ curl http://localhost:9999/B98A0678-3724-4BF5-9A4C-E84E06DDA1DD/list
{"status":"success","subject":[{"event_type":"discrete","timestamp":1523370322,"subje
ct":{"arch":"x86_64","state":"Shutdown","model":"iPhone 6","name":"iPhone
6","os":"iOS
11.2","udid":"B98A0678-3724-4BF5-9A4C-E84E06DDA1DD"},"event_name":"list"}],"events":[
]}
27
fbsimctl over http – exposed actions
● approve
● clearKeychain
● config
● diagnosticQuery
● diagnostic
● hid
● install
● launch
● list
● listApps
● open
● record
● relaunch
● search
● setLocation
● tap
● terminate
● uninstall
● upload
● screenshot
28
● boot
● create
● delete
● erase
● shutdown
● launch_xctest
● list_device_sets
fbsimctl over http – missing actions
29
● boot
● create
● delete
● erase
● shutdown
● launch_xctest
● list_device_sets
fbsimctl over http – missing actions
30
● Prepare and reset simulators on demand
● Start WebDriverAgent on simulators
● Hide away satisfying desired requirements
● Extra actions
● Pre-boot/Pool simulators
Why we need something on top of fbsimctl?
31
Remote Device API (Subset)
class RemoteDevice
...
def reset(timeout: 60); end
def clear_safari_cookies; end
...
def app_installed?(bundle_id); end
def create_driver(caps); end
...
def video_acquire; end
def video_start; end
def video_stop; end
def last_crash_log; end
32
Device Server model
33
Device Server model
34
Results & Next Steps
35
Results
● 1.5 hours → 0.5 hours
● 30 → 60 machines hosting simulators
● Decoupled tests and infrastructure
● Eased updates
● Simplified test runner
36
Next Steps
● Open-source
● Remove ssh
● Pre-booted simulators
37
Know-Hows
38
Simulators per host
MacBook Pro, Intel Core i7 @ 2.8 GHz, 4 Cores, 16 GB RAM
● 6 simulators
Mac Pro, Intel Xeon E5-2697 @ 2.7 GHz, 12 Cores, 128 GB RAM
● 3 VMs × 6 simulators
39
Resetting Simulator
Option 1: Straightforward
fbsimctl ${UDID} shutdown -- erase -- boot
Full boot ~ 18 seconds
40
Resetting Simulator
Option 2: Not so straightforward
cd $(fbsimctl list_device_sets)
fbsimctl ${UDID} shutdown
rm -rf ${UDID}
cp -rp ${UDID}_BACKUP ${UDID}
fbsimctl ${UDID} boot
Full boot ~ 8 seconds
41
$ fbsimctl B98A0678-3724-4BF5-9A4C-E84E06DDA1DD list_apps | grep MobileSafari
Bundle Name: MobileSafari | ID: com.apple.mobilesafari | Install Type system | Container
/Users/qa/Library/Developer/CoreSimulator/Devices/B98A0678-3724-4BF5-9A4C-E84E06DDA1DD/data/Containers/Data/
Application/22D18402-3D7B-4F28-88CF-98935328B0FB
$ rm -f /Users/qa/Library/Developer/CoreSimulator/Devices/B98A0678-3724-4BF5-9A4C-E84E06DDA1DD/data/
Containers/Data/Application/22D18402-3D7B-4F28-88CF-98935328B0FB/Library/Cookies/Cookies.binarycookies
Reset Cookies
42
Cleaning Up Disk
/private/var/folders/*/*/*/*-*-*/*.app
/private/var/folders/*/*/*/fbsimctl-*
$(fbsimctl list_device_sets)/*/data/Library/Caches/ ⤸
com.apple.mobile.installd.staging/*/*.app
43
Setting Up Simulator Host
# enable on-screen keyboard
defaults write com.apple.iphonesimulator ConnectHardwareKeyboard -bool false
# disable location
defaults write com.apple.iphonesimulator LocationMode "3101"
# turn off chrome
defaults write com.apple.iphonesimulator ShowChrome -bool false
# EnableKeyboardSync
# GraphicsQualityOverride
# OptimizeRenderingForWindowScale
# SlowMotionAnimation
44
Managing Infrastructure
● 64 hosts to manage + 6 TeamCity agents
● xcversion https://github.com/KrauseFx/xcode-install
● Ansible playbook to update fbsimctl, xcode, deploy configs, etc
● Ansible to remove outdated simulators after updates
45
Recap
Parallelisation
Separation
Know-Hows
46
Thank you!
48
● calabash-ios,
● WebDriverAgent
● FBSimulatorControl
● cucumber-ruby
● parallel_cucumber
49
Our automation stack
Remote Device API
class RemoteDevice
attr_reader :info
attr_reader :wda_endpoint
attr_reader :calabash_port
attr_reader :device_ref
def initialize(server_endpoint, device_ref); end
def release; end
def reset(timeout: 60); end
def await(timeout: 60); end
def set_location(lat:, lon:); end
def clear_safari_cookies; end
50
Remote Device API
def approve_access(bundle_ids); end
def app_installed?(bundle_id); end
def install_app(app_bundle_path); end
def launch_app(bundle_id); end
def list_apps; end
def open_url(url); end
def relaunch_app(bundle_id); end
def terminate_app(bundle_id); end
def uninstall_app(bundle_id); end
51
Remote Device API
def create_driver(caps); end
def user_ports; end
def endpoint_for(port); end
def screenshot(filetype, prefer_wda: true); end
def video_acquire; end
def video_start; end
def video_stop; end
def last_crash_log; end
end
52

Weitere ähnliche Inhalte

Was ist angesagt?

Performance optimization 101 - Erlang Factory SF 2014
Performance optimization 101 - Erlang Factory SF 2014Performance optimization 101 - Erlang Factory SF 2014
Performance optimization 101 - Erlang Factory SF 2014lpgauth
 
Swifty Serverless: How to minimise latencies and cold start period for server...
Swifty Serverless: How to minimise latencies and cold start period for server...Swifty Serverless: How to minimise latencies and cold start period for server...
Swifty Serverless: How to minimise latencies and cold start period for server...Vladimir Porokhov
 
Perfomance tuning on Go 2.0
Perfomance tuning on Go 2.0Perfomance tuning on Go 2.0
Perfomance tuning on Go 2.0Yogi Kulkarni
 
Telemetry indepth
Telemetry indepthTelemetry indepth
Telemetry indepthTianyou Li
 
LAS16-101: Efficient kernel backporting
LAS16-101: Efficient kernel backportingLAS16-101: Efficient kernel backporting
LAS16-101: Efficient kernel backportingLinaro
 
When Tools Attack
When Tools AttackWhen Tools Attack
When Tools AttackPerforce
 
Epoll - from the kernel side
Epoll -  from the kernel sideEpoll -  from the kernel side
Epoll - from the kernel sidellj098
 
Improving monitoring systems Interoperability with OpenMetrics
Improving monitoring systems Interoperability with OpenMetricsImproving monitoring systems Interoperability with OpenMetrics
Improving monitoring systems Interoperability with OpenMetricsChan Shik Lim
 
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...Anne Nicolas
 
Spying on the Linux kernel for fun and profit
Spying on the Linux kernel for fun and profitSpying on the Linux kernel for fun and profit
Spying on the Linux kernel for fun and profitAndrea Righi
 
Kernel Recipes 2019 - BPF at Facebook
Kernel Recipes 2019 - BPF at FacebookKernel Recipes 2019 - BPF at Facebook
Kernel Recipes 2019 - BPF at FacebookAnne Nicolas
 
Introduction to .NET Performance Measurement
Introduction to .NET Performance MeasurementIntroduction to .NET Performance Measurement
Introduction to .NET Performance MeasurementSasha Goldshtein
 
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)Wei Shan Ang
 
China.z / Trojan.XorDDOS - Analysis of a hack
China.z / Trojan.XorDDOS - Analysis of a hackChina.z / Trojan.XorDDOS - Analysis of a hack
China.z / Trojan.XorDDOS - Analysis of a hackhendrikvb
 
Intro to open source telemetry linux con 2016
Intro to open source telemetry   linux con 2016Intro to open source telemetry   linux con 2016
Intro to open source telemetry linux con 2016Matthew Broberg
 
High performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodbHigh performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodbWei Shan Ang
 
All of the thing about Postman
All of the thing about PostmanAll of the thing about Postman
All of the thing about PostmanAlihossein shahabi
 
BlaBlaCar Elastic Search Feedback
BlaBlaCar Elastic Search FeedbackBlaBlaCar Elastic Search Feedback
BlaBlaCar Elastic Search Feedbacksinfomicien
 
Measuring directly from cpu hardware performance counters
Measuring directly from cpu  hardware performance countersMeasuring directly from cpu  hardware performance counters
Measuring directly from cpu hardware performance countersJean-Philippe BEMPEL
 
BlaBlaCar and infrastructure automation
BlaBlaCar and infrastructure automationBlaBlaCar and infrastructure automation
BlaBlaCar and infrastructure automationsinfomicien
 

Was ist angesagt? (20)

Performance optimization 101 - Erlang Factory SF 2014
Performance optimization 101 - Erlang Factory SF 2014Performance optimization 101 - Erlang Factory SF 2014
Performance optimization 101 - Erlang Factory SF 2014
 
Swifty Serverless: How to minimise latencies and cold start period for server...
Swifty Serverless: How to minimise latencies and cold start period for server...Swifty Serverless: How to minimise latencies and cold start period for server...
Swifty Serverless: How to minimise latencies and cold start period for server...
 
Perfomance tuning on Go 2.0
Perfomance tuning on Go 2.0Perfomance tuning on Go 2.0
Perfomance tuning on Go 2.0
 
Telemetry indepth
Telemetry indepthTelemetry indepth
Telemetry indepth
 
LAS16-101: Efficient kernel backporting
LAS16-101: Efficient kernel backportingLAS16-101: Efficient kernel backporting
LAS16-101: Efficient kernel backporting
 
When Tools Attack
When Tools AttackWhen Tools Attack
When Tools Attack
 
Epoll - from the kernel side
Epoll -  from the kernel sideEpoll -  from the kernel side
Epoll - from the kernel side
 
Improving monitoring systems Interoperability with OpenMetrics
Improving monitoring systems Interoperability with OpenMetricsImproving monitoring systems Interoperability with OpenMetrics
Improving monitoring systems Interoperability with OpenMetrics
 
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
 
Spying on the Linux kernel for fun and profit
Spying on the Linux kernel for fun and profitSpying on the Linux kernel for fun and profit
Spying on the Linux kernel for fun and profit
 
Kernel Recipes 2019 - BPF at Facebook
Kernel Recipes 2019 - BPF at FacebookKernel Recipes 2019 - BPF at Facebook
Kernel Recipes 2019 - BPF at Facebook
 
Introduction to .NET Performance Measurement
Introduction to .NET Performance MeasurementIntroduction to .NET Performance Measurement
Introduction to .NET Performance Measurement
 
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
 
China.z / Trojan.XorDDOS - Analysis of a hack
China.z / Trojan.XorDDOS - Analysis of a hackChina.z / Trojan.XorDDOS - Analysis of a hack
China.z / Trojan.XorDDOS - Analysis of a hack
 
Intro to open source telemetry linux con 2016
Intro to open source telemetry   linux con 2016Intro to open source telemetry   linux con 2016
Intro to open source telemetry linux con 2016
 
High performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodbHigh performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodb
 
All of the thing about Postman
All of the thing about PostmanAll of the thing about Postman
All of the thing about Postman
 
BlaBlaCar Elastic Search Feedback
BlaBlaCar Elastic Search FeedbackBlaBlaCar Elastic Search Feedback
BlaBlaCar Elastic Search Feedback
 
Measuring directly from cpu hardware performance counters
Measuring directly from cpu  hardware performance countersMeasuring directly from cpu  hardware performance counters
Measuring directly from cpu hardware performance counters
 
BlaBlaCar and infrastructure automation
BlaBlaCar and infrastructure automationBlaBlaCar and infrastructure automation
BlaBlaCar and infrastructure automation
 

Ähnlich wie Remote iOS Devices Server – Scaling iOS

Expedia 3x3 presentation
Expedia 3x3 presentationExpedia 3x3 presentation
Expedia 3x3 presentationDrew Hannay
 
PuppetConf 2016: Why Network Automation Matters, and What You Can Do About It...
PuppetConf 2016: Why Network Automation Matters, and What You Can Do About It...PuppetConf 2016: Why Network Automation Matters, and What You Can Do About It...
PuppetConf 2016: Why Network Automation Matters, and What You Can Do About It...Puppet
 
Software Testing
Software TestingSoftware Testing
Software TestingAndrew Wang
 
Antifragility and testing for distributed systems failure
Antifragility and testing for distributed systems failureAntifragility and testing for distributed systems failure
Antifragility and testing for distributed systems failureDiUS
 
Containerize your Blackbox tests
Containerize your Blackbox testsContainerize your Blackbox tests
Containerize your Blackbox testsKevin Beeman
 
Docker–Grid (A On demand and Scalable dockerized selenium grid architecture)
Docker–Grid (A On demand and Scalable dockerized selenium grid architecture)Docker–Grid (A On demand and Scalable dockerized selenium grid architecture)
Docker–Grid (A On demand and Scalable dockerized selenium grid architecture)STePINForum
 
How We Test MongoDB: Evergreen
How We Test MongoDB: EvergreenHow We Test MongoDB: Evergreen
How We Test MongoDB: EvergreenMongoDB
 
Working Without Wires
Working Without WiresWorking Without Wires
Working Without WiresKinoma
 
Jenkinsconf Presentation - Advance jenkins management with multiple projects.
Jenkinsconf Presentation - Advance jenkins management with multiple projects.Jenkinsconf Presentation - Advance jenkins management with multiple projects.
Jenkinsconf Presentation - Advance jenkins management with multiple projects.Ohad Basan
 
"Using Automation Tools To Deploy And Operate Applications In Real World Scen...
"Using Automation Tools To Deploy And Operate Applications In Real World Scen..."Using Automation Tools To Deploy And Operate Applications In Real World Scen...
"Using Automation Tools To Deploy And Operate Applications In Real World Scen...ConSol Consulting & Solutions Software GmbH
 
"Using Automation Tools To Deploy And Operate Applications In Real World Scen...
"Using Automation Tools To Deploy And Operate Applications In Real World Scen..."Using Automation Tools To Deploy And Operate Applications In Real World Scen...
"Using Automation Tools To Deploy And Operate Applications In Real World Scen...ConSol Consulting & Solutions Software GmbH
 
What’s eating python performance
What’s eating python performanceWhat’s eating python performance
What’s eating python performancePiotr Przymus
 
Adopting agile in an embedded platform Suryakiran Kasturi & Akhil Kumar
Adopting agile in an embedded platform  Suryakiran Kasturi & Akhil KumarAdopting agile in an embedded platform  Suryakiran Kasturi & Akhil Kumar
Adopting agile in an embedded platform Suryakiran Kasturi & Akhil KumarXP Conference India
 
Mirko Damiani - An Embedded soft real time distributed system in Go
Mirko Damiani - An Embedded soft real time distributed system in GoMirko Damiani - An Embedded soft real time distributed system in Go
Mirko Damiani - An Embedded soft real time distributed system in Golinuxlab_conf
 
Pharo Virtual Machine: News from the Front
Pharo Virtual Machine: News from the FrontPharo Virtual Machine: News from the Front
Pharo Virtual Machine: News from the FrontESUG
 
Дмитрий Лемешко. Comaqa Spring 2018. Continuous mobile automation in build pi...
Дмитрий Лемешко. Comaqa Spring 2018. Continuous mobile automation in build pi...Дмитрий Лемешко. Comaqa Spring 2018. Continuous mobile automation in build pi...
Дмитрий Лемешко. Comaqa Spring 2018. Continuous mobile automation in build pi...COMAQA.BY
 
Benchmarking at Parse
Benchmarking at ParseBenchmarking at Parse
Benchmarking at ParseTravis Redman
 
Advanced Benchmarking at Parse
Advanced Benchmarking at ParseAdvanced Benchmarking at Parse
Advanced Benchmarking at ParseMongoDB
 

Ähnlich wie Remote iOS Devices Server – Scaling iOS (20)

Expedia 3x3 presentation
Expedia 3x3 presentationExpedia 3x3 presentation
Expedia 3x3 presentation
 
PuppetConf 2016: Why Network Automation Matters, and What You Can Do About It...
PuppetConf 2016: Why Network Automation Matters, and What You Can Do About It...PuppetConf 2016: Why Network Automation Matters, and What You Can Do About It...
PuppetConf 2016: Why Network Automation Matters, and What You Can Do About It...
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Antifragility and testing for distributed systems failure
Antifragility and testing for distributed systems failureAntifragility and testing for distributed systems failure
Antifragility and testing for distributed systems failure
 
Containerize your Blackbox tests
Containerize your Blackbox testsContainerize your Blackbox tests
Containerize your Blackbox tests
 
Ci for android OS
Ci for android OSCi for android OS
Ci for android OS
 
Docker–Grid (A On demand and Scalable dockerized selenium grid architecture)
Docker–Grid (A On demand and Scalable dockerized selenium grid architecture)Docker–Grid (A On demand and Scalable dockerized selenium grid architecture)
Docker–Grid (A On demand and Scalable dockerized selenium grid architecture)
 
How We Test MongoDB: Evergreen
How We Test MongoDB: EvergreenHow We Test MongoDB: Evergreen
How We Test MongoDB: Evergreen
 
Working Without Wires
Working Without WiresWorking Without Wires
Working Without Wires
 
Jenkinsconf Presentation - Advance jenkins management with multiple projects.
Jenkinsconf Presentation - Advance jenkins management with multiple projects.Jenkinsconf Presentation - Advance jenkins management with multiple projects.
Jenkinsconf Presentation - Advance jenkins management with multiple projects.
 
OpenCms Days 2015 Workflow using Docker and Jenkins
OpenCms Days 2015 Workflow using Docker and JenkinsOpenCms Days 2015 Workflow using Docker and Jenkins
OpenCms Days 2015 Workflow using Docker and Jenkins
 
"Using Automation Tools To Deploy And Operate Applications In Real World Scen...
"Using Automation Tools To Deploy And Operate Applications In Real World Scen..."Using Automation Tools To Deploy And Operate Applications In Real World Scen...
"Using Automation Tools To Deploy And Operate Applications In Real World Scen...
 
"Using Automation Tools To Deploy And Operate Applications In Real World Scen...
"Using Automation Tools To Deploy And Operate Applications In Real World Scen..."Using Automation Tools To Deploy And Operate Applications In Real World Scen...
"Using Automation Tools To Deploy And Operate Applications In Real World Scen...
 
What’s eating python performance
What’s eating python performanceWhat’s eating python performance
What’s eating python performance
 
Adopting agile in an embedded platform Suryakiran Kasturi & Akhil Kumar
Adopting agile in an embedded platform  Suryakiran Kasturi & Akhil KumarAdopting agile in an embedded platform  Suryakiran Kasturi & Akhil Kumar
Adopting agile in an embedded platform Suryakiran Kasturi & Akhil Kumar
 
Mirko Damiani - An Embedded soft real time distributed system in Go
Mirko Damiani - An Embedded soft real time distributed system in GoMirko Damiani - An Embedded soft real time distributed system in Go
Mirko Damiani - An Embedded soft real time distributed system in Go
 
Pharo Virtual Machine: News from the Front
Pharo Virtual Machine: News from the FrontPharo Virtual Machine: News from the Front
Pharo Virtual Machine: News from the Front
 
Дмитрий Лемешко. Comaqa Spring 2018. Continuous mobile automation in build pi...
Дмитрий Лемешко. Comaqa Spring 2018. Continuous mobile automation in build pi...Дмитрий Лемешко. Comaqa Spring 2018. Continuous mobile automation in build pi...
Дмитрий Лемешко. Comaqa Spring 2018. Continuous mobile automation in build pi...
 
Benchmarking at Parse
Benchmarking at ParseBenchmarking at Parse
Benchmarking at Parse
 
Advanced Benchmarking at Parse
Advanced Benchmarking at ParseAdvanced Benchmarking at Parse
Advanced Benchmarking at Parse
 

Kürzlich hochgeladen

Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxalwaysnagaraju26
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...Nitya salvi
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 

Kürzlich hochgeladen (20)

Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 

Remote iOS Devices Server – Scaling iOS

  • 1. Remote iOS Device Server Scaling iOS testing Nikolai Abalov
  • 2. Hello, my name is Nikolai Abalov Senior Automation Engineer at Badoo Previously Senior Developer and Automation Engineer at 2GIS for 3 years Co-creator of Winium.Mobile From Siberia github.com/NickAb @NickAb
  • 3. Agenda 1. Introduction 2. Parallel tests on iOS 3. Device Server 4. Results & next steps 5. Know-Hows — how to apply it at your scale 6. Recap 3
  • 5. What we had ● 10 Pull Requests per day to the app repo ● 1200+ end-to-end tests ● 35+ hours of cpu-time ● 1.5 hours wall-clock time ● 1500+ cpu-time hours per day ● Extra projects on the same infrastructure ● Tightly coupled tests and infrastructure 5
  • 6. What we want ● People trusting the automation ● Fast and reliable feedback 6
  • 7. What we want ● 30 minutes wall-clock ● Stability ● Scalability ● Easy maintenance and development 7
  • 8. How to get there ● Delete ⅔ of tests 8
  • 10. Joking aside ● Filter tests based on change set, coverage, components ● Speed up and stabilise tests ● Heavily parallelise test runs ● Provide scalable infrastructure to run tests 10
  • 12. Test parallelisation 1200 tests ∕ 1 simulator = 40 hours 1200 tests ∕ X simulators = 0.5 hours X = 80 simulators 12
  • 13. Options ● 3rd party cloud ● SauceLabs / TestObject ● Xamarin Test Cloud ● AWS Device Farm ● In-house 13
  • 14. Multiple users, simulator per user Agent Rake / Parallel Cucumber ssh qa1@h1 ssh qa2@h1 ssh qa1@h2 ssh qa2@h2 macOS, Xcode, Ruby, … 14 Test Test Test Test iOS Calabash in parallel on one host by Tim Baverstock
  • 15. Single user, multiple simulators Agent Rake / Parallel Cucumber ssh qa@h1 ssh qa@h1 ssh qa@h2 ssh qa@h2 15 Test Test Test Test Test Test iOS Parallel Automation: run faster than fast by Viktar Karanevich Turning iOS End to End Testing up to 11 by Lawrence Lomax macOS, Xcode, Ruby, …
  • 16. Issues with current model ● Tight coupling of test code and infrastructure ● Hard to scale ● No sharing of resources between test jobs on CI ● Tests are bound to simulator host machine ● Too easy to mess with simulator internals 16
  • 18. New model Not bound to macOS 18 Device Server Agent Rake / Parallel Cucumber http Test Test Test Test Test Test http http http http http
  • 19. New model Device Server ssh ssh ssh ssh macOS, Xcode, … 19 Agent Rake / Parallel Cucumber Not bound to macOS http Test Test Test Test Test Test http http http http http ssh ssh
  • 20. New model ● Separation of concerns ● Well-defined interface ● Cheaper test environments ● Easy sharing of resources between test jobs on CI 20
  • 21. Why move? Sharing t Agent 1 Simulators Agent 2 Simulators 1 2 3 4 5 6 t Shared Simulators 1 2 3 4 21 before after
  • 22. More reasons to move ● Black boxing ● Easier updates ● No more xcrun simctl, fbsimctl, idevice* ● No more messing with internals 22
  • 23. ● Did not fit well with existing code ● We need custom actions ● We need flexibility and fast prototyping Why not Selenium Grid? 23
  • 25. Tools we were using before ● xcrun simctl ● fbsimctl ● WebDriverAgent ● ideviceinstaller 25
  • 26. Tools we use now ● fbsimctl ● WebDriverAgent 26
  • 27. fbsimctl as a server $ fbsimctl boot -- listen --http 9999 -- shutdown listen started: Http: 9999 Hid: No stdin: false GET: /5C34FF6A-4585-406A-A14F-4C0881B74110/list $ curl http://localhost:9999/B98A0678-3724-4BF5-9A4C-E84E06DDA1DD/list {"status":"success","subject":[{"event_type":"discrete","timestamp":1523370322,"subje ct":{"arch":"x86_64","state":"Shutdown","model":"iPhone 6","name":"iPhone 6","os":"iOS 11.2","udid":"B98A0678-3724-4BF5-9A4C-E84E06DDA1DD"},"event_name":"list"}],"events":[ ]} 27
  • 28. fbsimctl over http – exposed actions ● approve ● clearKeychain ● config ● diagnosticQuery ● diagnostic ● hid ● install ● launch ● list ● listApps ● open ● record ● relaunch ● search ● setLocation ● tap ● terminate ● uninstall ● upload ● screenshot 28
  • 29. ● boot ● create ● delete ● erase ● shutdown ● launch_xctest ● list_device_sets fbsimctl over http – missing actions 29
  • 30. ● boot ● create ● delete ● erase ● shutdown ● launch_xctest ● list_device_sets fbsimctl over http – missing actions 30
  • 31. ● Prepare and reset simulators on demand ● Start WebDriverAgent on simulators ● Hide away satisfying desired requirements ● Extra actions ● Pre-boot/Pool simulators Why we need something on top of fbsimctl? 31
  • 32. Remote Device API (Subset) class RemoteDevice ... def reset(timeout: 60); end def clear_safari_cookies; end ... def app_installed?(bundle_id); end def create_driver(caps); end ... def video_acquire; end def video_start; end def video_stop; end def last_crash_log; end 32
  • 35. Results & Next Steps 35
  • 36. Results ● 1.5 hours → 0.5 hours ● 30 → 60 machines hosting simulators ● Decoupled tests and infrastructure ● Eased updates ● Simplified test runner 36
  • 37. Next Steps ● Open-source ● Remove ssh ● Pre-booted simulators 37
  • 39. Simulators per host MacBook Pro, Intel Core i7 @ 2.8 GHz, 4 Cores, 16 GB RAM ● 6 simulators Mac Pro, Intel Xeon E5-2697 @ 2.7 GHz, 12 Cores, 128 GB RAM ● 3 VMs × 6 simulators 39
  • 40. Resetting Simulator Option 1: Straightforward fbsimctl ${UDID} shutdown -- erase -- boot Full boot ~ 18 seconds 40
  • 41. Resetting Simulator Option 2: Not so straightforward cd $(fbsimctl list_device_sets) fbsimctl ${UDID} shutdown rm -rf ${UDID} cp -rp ${UDID}_BACKUP ${UDID} fbsimctl ${UDID} boot Full boot ~ 8 seconds 41
  • 42. $ fbsimctl B98A0678-3724-4BF5-9A4C-E84E06DDA1DD list_apps | grep MobileSafari Bundle Name: MobileSafari | ID: com.apple.mobilesafari | Install Type system | Container /Users/qa/Library/Developer/CoreSimulator/Devices/B98A0678-3724-4BF5-9A4C-E84E06DDA1DD/data/Containers/Data/ Application/22D18402-3D7B-4F28-88CF-98935328B0FB $ rm -f /Users/qa/Library/Developer/CoreSimulator/Devices/B98A0678-3724-4BF5-9A4C-E84E06DDA1DD/data/ Containers/Data/Application/22D18402-3D7B-4F28-88CF-98935328B0FB/Library/Cookies/Cookies.binarycookies Reset Cookies 42
  • 43. Cleaning Up Disk /private/var/folders/*/*/*/*-*-*/*.app /private/var/folders/*/*/*/fbsimctl-* $(fbsimctl list_device_sets)/*/data/Library/Caches/ ⤸ com.apple.mobile.installd.staging/*/*.app 43
  • 44. Setting Up Simulator Host # enable on-screen keyboard defaults write com.apple.iphonesimulator ConnectHardwareKeyboard -bool false # disable location defaults write com.apple.iphonesimulator LocationMode "3101" # turn off chrome defaults write com.apple.iphonesimulator ShowChrome -bool false # EnableKeyboardSync # GraphicsQualityOverride # OptimizeRenderingForWindowScale # SlowMotionAnimation 44
  • 45. Managing Infrastructure ● 64 hosts to manage + 6 TeamCity agents ● xcversion https://github.com/KrauseFx/xcode-install ● Ansible playbook to update fbsimctl, xcode, deploy configs, etc ● Ansible to remove outdated simulators after updates 45
  • 48. 48
  • 49. ● calabash-ios, ● WebDriverAgent ● FBSimulatorControl ● cucumber-ruby ● parallel_cucumber 49 Our automation stack
  • 50. Remote Device API class RemoteDevice attr_reader :info attr_reader :wda_endpoint attr_reader :calabash_port attr_reader :device_ref def initialize(server_endpoint, device_ref); end def release; end def reset(timeout: 60); end def await(timeout: 60); end def set_location(lat:, lon:); end def clear_safari_cookies; end 50
  • 51. Remote Device API def approve_access(bundle_ids); end def app_installed?(bundle_id); end def install_app(app_bundle_path); end def launch_app(bundle_id); end def list_apps; end def open_url(url); end def relaunch_app(bundle_id); end def terminate_app(bundle_id); end def uninstall_app(bundle_id); end 51
  • 52. Remote Device API def create_driver(caps); end def user_ports; end def endpoint_for(port); end def screenshot(filetype, prefer_wda: true); end def video_acquire; end def video_start; end def video_stop; end def last_crash_log; end end 52