Top Banner
69

ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

Jan 13, 2017

Download

Engineering

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud
Page 2: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

Continuous Integration at SoundCloud

Istanbul Tech Talks 2015

Vincent Garrigues @garriguv

Page 3: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

Why invest in a mobile CI pipeline?

Page 4: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

• move fast • keep codebase healthy • confidence • ship reliable apps

Page 5: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

• move fast • keep codebase healthy • confidence • ship reliable apps

Page 6: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud
Page 7: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud
Page 8: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

• started from scratch • months in development • millions of users

Page 9: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

iOS Crash Complaints (avg per Week)

0

35

70

105

140

April May June July August

2014 SoundCloud community team

Page 10: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

iOS Crash Complaints (avg per Week)

0

35

70

105

140

April 2014 July 2014 October 2014 January 2015

2015 SoundCloud community team

Page 11: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud
Page 12: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

How do we work?

Page 13: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

• work on master • little to no branches • pairing • feature flags

Page 14: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

- (id<AnalyticsProviderInterface>)soundcloudInternalProvider { if ([FlipTheSwitch isDevEventgatewayEnabled]) { return [self eventGatewayProvider]; } else { return [self eventLoggerProvider]; } }

Feature flagging

github.com/michaelengland/fliptheswitch

Page 15: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

Feature flagging

Page 16: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

Timeline

Page 17: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

2012 2013 2014 2015

📱📱📱 📱

📱📱📱📱📱

📱📱📱📱📱📱📱📱📱📱

Page 18: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

started very simple

Page 19: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud
Page 20: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

Page 21: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud
Page 22: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

• unit tests • α and β builds • app store build

Page 23: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

Overview of the current

system

Page 24: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

buildanalysis

unit tests

acceptance tests

AppStoreAdHocα and β

🚦 🚦

Page 25: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

buildanalysis

unit tests

acceptance tests

AppStoreAdHocα and β

~ 5min 30sec ~ 7min ~ 3min

~ 15min

🚦 🚦

Page 26: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

Let's have a look at the

details

Page 27: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

buildanalysis

unit tests

acceptance tests

AppStoreAdHocα and β

🚦 🚦

Page 28: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

build unit tests

acceptance tests build

linter

dependencies

local librariesunit tests

i18n push

Page 29: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

build

local librariesunit tests

i18n push

unit tests

acceptance tests build

linter

dependencies

Page 30: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

build unit tests

acceptance tests build

linter

dependencies

~2000

local librariesunit tests

i18n push

Page 31: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

build unit tests

acceptance tests build

linter

dependencies

~2000

~5000

local librariesunit tests

i18n push

Page 32: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

build unit tests

acceptance tests build

linter

dependencies

~2000

~5000

local librariesunit tests

i18n push

Page 33: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

build unit tests

acceptance tests build

linter

dependencies

~5000

~2000

local librariesunit tests

i18n push

Page 34: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

build unit tests

acceptance tests build

linter

dependencies

~5000

~2000

local librariesunit tests

i18n push

Page 35: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

buildanalysis

unit tests

acceptance tests

AppStoreAdHocα and β

🚦 🚦

Page 36: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

• frank • cucumber

http://www.testingwithfrank.comhttps://cukes.info

Page 37: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud
Page 38: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

• flexible platform & OS • bandwidth and reachability

settings • launch arguments

Page 39: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

stubby4j

⛔datasets

Page 40: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

mobile apiproxy

The proxy can change: • response status code • response body • record and undo actions

(like, repost…)

Page 41: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

~360 acceptance

tests

Page 42: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

~360 acceptance

tests~250 min

Page 43: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

Sharding

Page 44: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

distributed cucumber

Page 45: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

distributed cucumber

Page 46: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

x20

VM

Page 47: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

buildanalysis

unit tests

acceptance tests

AppStoreAdHocα and β

🚦 🚦

~ 5min 30sec ~ 7min ~ 3min

~ 15min

Page 48: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

acceptance tests

• iOS version • iPhone (4S, 5, 6, 6+) • iPad (retina and non retina) • feature flag configurations

Page 49: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

What's the value of an acceptance

test?

Page 50: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

avoid regressions on

hard to test flows/screens

Page 51: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud
Page 52: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud
Page 53: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

keeping the build green

Page 54: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud
Page 55: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud
Page 56: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

pre-ci

Page 57: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

https://www.youtube.com/watch?v=BhMSzC1crr0 SpaceX

Page 58: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

Flaky tests

Page 59: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

Flaky tests• test driver is flaky • backend is flaky • app is unpredictable

Page 60: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

Flaky tests• identify • isolate • fix

Page 61: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

flakyrazor

Page 62: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

flakyrazor1. Take failing test out of the test pool

2. Run the test multiple times (flaky or failing?)

3. Assign it to the author/committer

Page 63: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

flakyrazor4. Assess test value 5. Act on test duration changes 6. Show statistics on why the test failed

Page 64: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

Taking care of our build machines

Page 65: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

❤ ❤

Page 66: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud
Page 67: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

• we have images for all the machines

• CLIs to provision the machines remotely

• OS X server stores the images and controls the imaging process

Page 68: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

What about Android?

Page 69: ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud

Thank you!Istanbul Tech Talks 2015

Vincent Garrigues @garriguv