SlideShare a Scribd company logo
1 of 67
Download to read offline
Yet Another Continuous
Integration Story
Who I Am
● Anton Serdyuk
● Technical Leader at Startup Labs, Inc.
● anton.serdyuk@gmail.com
● anton.serdyuk@itstartuplabs.com
● @anton_serdyuk
● Skype: serdyuk.anton
Disclaimer
Disclaimer

Projects are different
● Technical requirements
● Business requirements
● Length
● Budget
● Load
● Data size
● etc
Disclaimer

Teams are different
● Level
● Size
● Structure
● etc
Disclaimer

There is no silver bullet
● Worked for us != will work for you
● Adopt patterns and principles rather than the full
process
Who We Are
Who We Are

Project
● b2b system
● Unexpected downtime is very expensive
● Bugs in production are also very expensive because of
the reputation loss
● Small amount of traffic (But expensive)
● 1.5 years
● 4-15 developers (+ layout, + qa)
● 15 Gb Database (Grows not very fast)
Who We Are

Technologies
● PHP 5.4
● Java 7
● PostgreSQL
● RabbitMQ
Who We Are

Frameworks
● Hibernate
● JUnit
● Symfony2
● Silex
● Behat
● PHPUnit
Goals and Principles
Goals and Principles

Agile
● Small changes
● Frequent releases
● Early feedback
What Is NOT Our Way
What Is NOT Our Way

Git Flow
What Is NOT Our Way

Feature Branches

feature1

master

feature2
What Is NOT Our Way

Feature Branches
Active feature branches usage example
What Is NOT Our Way

Release Branches
1.1.x
1.0.x

master
What Is NOT Our Way

master/staging/develop branches
develop

master
What Is NOT Our Way

Release Tags

v1.1.1

v1.1.2

master
What IS Our Way
What IS Our Way

Continuous Integration
● Push every day
● Build every commit
● Run all tests on every build
● Fix red builds quickly
What IS Our Way

One Branch

master
What IS Our Way

Branch by Abstraction
● Commit switch-off for this feature
● Develop, integrate
● … your code in production now, but switched-off
● Develop, integrate
● Test
● Switch-on this feature in production
What IS Our Way

Autotests
● QAs write behat scenarios
● Developers implement
● Every feature covered by behat scenarios
● Great regression tests suite - easy refactoring, less
bugs
● + ~100% development cost
What IS Our Way

Every Build Is Release Candidate
● Do not push if state after commit is not suitable for
production
What IS Our Way

Some Numbers
● ~1000 behat scenarios (unit tests are not counted)
● ~15 minutes build duration
● 2 build servers (Intel Xeon, 32 Gb RAM, SSD)
● 5-6 build agents for tests (VMs)
● 3 build agents for build phase (VMs)
● ~15 builds per day
● 2 releases per week
Build Process
Build Process

Overview

build

automatic tests

manual tests

load and prod
migrate tests

production
Build Process

Overview
bamboo

pull
build

git
repository

push

developers

build
build
agent
agents

test
test
test
test
agents
test
agents
agents
agents

QA
server

pre
prod

prod

artifacts

apt
repository

puppet
master

tune
release engineer
(architect/admin)
Build Process

Use The Same Artifacts

build
build
agent
agents

artifacts

apt
repository

test
test
test
agents
test
agents
agents
agents

QA
server

pre
prod

prod
Build Process

Autoconfigure All Environments
test
test
test
agents
test
agents
agents
agents

QA
server

puppet
master

pre
prod

prod

tune
release engineer
(architect/admin)
Build Process

Deploy by Pressing a Button

bamboo

test
test
test
agents
test
agents
agents
agents

QA
server

pre
prod

prod
Build Phase
Build Phase

Goals
● Create artifacts which will be used in all phases
● Run unit tests
Build Phase

Technologies
● Phing
● Maven
● deb-packages (dpkg-buildpackage)
● PHPUnit
● JUnit
Build Phase

Example
Automatic Test Phase
Automatic Test Phase

Goals
● Run functional tests
Automatic Test Phase

Deploy to Completely Clean System
Automatic Test Phase

Run Tests in Parallel
agent 1
behat process 1

application 1

agent 2
behat process 2

application 2

...
agent 5
behat process 5

application 5
Automatic Test Phase

Run Tests in Parallel
feature 1
feature 2

job 01

agent 1

feature 3
feature 4
feature 5

job 02

feature 6

agent 2

feature 7
feature 8

job 03

feature 9

...

...

feature 50
feature 51

Job 15

agent 3
Automatic Test Phase

Run Tests in Parallel
github: StartupLabs/behat-partial-runner
● bin/behat --count 15 --current 1
● bin/behat --count 15 --current 2
● bin/behat --count 15 --current 3
● bin/behat --count 15 --current 4
● bin/behat --count 15 --current 5
● …
● bin/behat --count 15 --current 15
Automatic Test Phase

Write Fast Tests
● Continuously speed-up your tests
● Use curl instead of Selenium
● Put initial data directly to DB
● etc
Automatic Test Phase

Write Fast Tests
Merge scenarios which do not modify data
Feature: Posts pagination

Feature: Posts pagination

Background:

Background:

Given I am logged in as admin

Given I am logged in as admin

And there is many posts

And there is many posts

Scenario: Pagination works

Scenario: All pagination tests

Given I am at the posts list

# Scenario: Pagination works

Then I should see pagination

Given I am at the posts list
Then I should see pagination

Scenario: Link “last” works
Given I am at the posts list

# Scenario: Link “last” works

When I click at the “last” link

When I click at the “last” link

Then I should see last page

Then I should see last page
Automatic Test Phase

Write Fast Tests
Translate outline to single scenarios with TableNode
Feature: Post validation

Feature: Post validation

Background:

Background:

Given I am logged in as admin

Given I am logged in as admin

And I am on post add page

And I am on post add page

Scenario Outline: Validation works

Scenario: Validation works

When I enter <value> into <field>

Then I should see such errors with such
input

Then I should see error <error>

| field | value | error

Examples:
| field | value | error

|

| title |

| Can not be empty

|

| tags

| Should be letters |

| %%%%

|

| title |

|

| Can not be empty

| tags | %%%% | Should be letters |
Automatic Test Phase

Write Fast Tests
Parallel test execution
@parallel
Feature: Login

server
behat process 1

Background:
Given I am registered user

alex = alex1
alex = alex2

application

behat process 2

| username | alex |
| password | 123 |
Scenario: I can login
Given I am at the login page
When I fill form with

● Many problems with race
conditions

| username | alex |
| password | 123 |
Then I should be logged in

● Not worked for us :(
Manual Test Phase
Manual Test Phase

Goals
● Run manual tests
● Place where QA see new functionality
Manual Test Phase
● Deploy to completely clean system
Load and Prod Migrate
Tests
Load and Prod Migrate Tests

Load Tests Goals
● Catch race conditions
● Catch serious performance degradation when database
grows or after adding new functionality
Load and Prod Migrate Tests

Prod Migrate Tests Goals
● Test migrations on real data
● Test migrations time on real data
Load and Prod Migrate Tests
● Migrate load test env to new version
● Rollback migrate test env to production snapshot
Deploy to Production
Deploy to Production
● nb-prod - small production copy used by other teams for
integration purposes
Problems
Problems

Red Builds for a Long Time
● QA can not deploy new version to staging
● New commits make new tests red like a snowball
● Nobody knows who are responsible for all those failed
tests

Solutions:
● If build can not be fixed in 15 minutes - revert commit
● Autoreverts on red builds (?)
Problems

Long Builds
● Nobody wants to wait green build
● Nobody cares about green build after commit
● Red builds for a long time

Solutions:
● Speedup tests
● Parallel build
● Add more build servers
Problems

Blinking Failures
● Failures are trustless - “it is not my fault - it is blinking,
just do rebuild”
● Time consuming

Solutions:
● Eliminate them ASAP
● Do not just run “Rebuild failed jobs”
Key Points, Again
Key Points, Again

Autotests
● There is no sense in CI without tests
● Easy refactoring
● Less bugs
Key Points, Again

Fast Builds
● Long builds => More changes => Red builds

● Fast tests
● Parallel run
● Hacks in tests
● etc
Key Points, Again

One branch
● There are no builds from other branches
● There are no hotfixes
● Easy deploy and build pipeline
Todo
Todo
● Rollback strategy
● Use Bamboo deployment
Inspired By
● Continuous Delivery: Reliable Software Releases
through Build, Test, and Deployment Automation (Jez
Humble, David Farley)
● http://timothyfitz.com/
Questions?

More Related Content

What's hot

Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)Alin Pandichi
 
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)Alvaro Sanchez-Mariscal
 
cf.Objective() 2017 - Design patterns - Brad Wood
cf.Objective() 2017 - Design patterns - Brad Woodcf.Objective() 2017 - Design patterns - Brad Wood
cf.Objective() 2017 - Design patterns - Brad WoodOrtus Solutions, Corp
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumberNibu Baby
 
TDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
TDD for APIs @ Europython 2015, Bilbao by Michael KuehneTDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
TDD for APIs @ Europython 2015, Bilbao by Michael KuehneMichael Kuehne-Schlinkert
 
Insights on Protractor testing
Insights on Protractor testingInsights on Protractor testing
Insights on Protractor testingDejan Toteff
 
AN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLE
AN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLEAN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLE
AN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLEGavin Pickin
 
BDD with SpecFlow and Selenium
BDD with SpecFlow and SeleniumBDD with SpecFlow and Selenium
BDD with SpecFlow and SeleniumLiraz Shay
 
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...OdessaJS Conf
 
[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...
[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...
[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...Applitools
 
Automated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and SeleniumAutomated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and SeleniumDev9Com
 
Selenium + Specflow
Selenium + SpecflowSelenium + Specflow
Selenium + Specflowcromwellryan
 
Behat bdd training (php) course slides pdf
Behat bdd training (php) course slides pdfBehat bdd training (php) course slides pdf
Behat bdd training (php) course slides pdfseleniumbootcamp
 
Php[tek] 2016 - BDD with Behat for Beginners
Php[tek] 2016 - BDD with Behat for BeginnersPhp[tek] 2016 - BDD with Behat for Beginners
Php[tek] 2016 - BDD with Behat for BeginnersAdam Englander
 
North Virginia Coldfusion User Group Meetup - Testbox - July 19th 2017
North Virginia Coldfusion User Group Meetup - Testbox - July 19th 2017North Virginia Coldfusion User Group Meetup - Testbox - July 19th 2017
North Virginia Coldfusion User Group Meetup - Testbox - July 19th 2017Ortus Solutions, Corp
 

What's hot (20)

Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)
 
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
 
Test Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and CucumberTest Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and Cucumber
 
cf.Objective() 2017 - Design patterns - Brad Wood
cf.Objective() 2017 - Design patterns - Brad Woodcf.Objective() 2017 - Design patterns - Brad Wood
cf.Objective() 2017 - Design patterns - Brad Wood
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumber
 
TDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
TDD for APIs @ Europython 2015, Bilbao by Michael KuehneTDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
TDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
 
Insights on Protractor testing
Insights on Protractor testingInsights on Protractor testing
Insights on Protractor testing
 
AN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLE
AN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLEAN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLE
AN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLE
 
Agile Testing
Agile TestingAgile Testing
Agile Testing
 
BDD with SpecFlow and Selenium
BDD with SpecFlow and SeleniumBDD with SpecFlow and Selenium
BDD with SpecFlow and Selenium
 
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
 
Protractor training
Protractor trainingProtractor training
Protractor training
 
[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...
[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...
[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...
 
Automated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and SeleniumAutomated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and Selenium
 
EVOLVE'15 | Enhance | Rene Ugarte | AEM Quality Assurance
EVOLVE'15 | Enhance | Rene Ugarte | AEM Quality AssuranceEVOLVE'15 | Enhance | Rene Ugarte | AEM Quality Assurance
EVOLVE'15 | Enhance | Rene Ugarte | AEM Quality Assurance
 
Selenium + Specflow
Selenium + SpecflowSelenium + Specflow
Selenium + Specflow
 
Behat bdd training (php) course slides pdf
Behat bdd training (php) course slides pdfBehat bdd training (php) course slides pdf
Behat bdd training (php) course slides pdf
 
Php[tek] 2016 - BDD with Behat for Beginners
Php[tek] 2016 - BDD with Behat for BeginnersPhp[tek] 2016 - BDD with Behat for Beginners
Php[tek] 2016 - BDD with Behat for Beginners
 
Bdd and spec flow
Bdd and spec flowBdd and spec flow
Bdd and spec flow
 
North Virginia Coldfusion User Group Meetup - Testbox - July 19th 2017
North Virginia Coldfusion User Group Meetup - Testbox - July 19th 2017North Virginia Coldfusion User Group Meetup - Testbox - July 19th 2017
North Virginia Coldfusion User Group Meetup - Testbox - July 19th 2017
 

Similar to Yet Another CI Story: Continuous Integration at a Startup

Unit testing legacy code
Unit testing legacy codeUnit testing legacy code
Unit testing legacy codeLars Thorup
 
Code review and automated testing for Puppet code
Code review and automated testing for Puppet codeCode review and automated testing for Puppet code
Code review and automated testing for Puppet codewzzrd
 
High Performance Software Engineering Teams
High Performance Software Engineering TeamsHigh Performance Software Engineering Teams
High Performance Software Engineering TeamsLars Thorup
 
Passing the Joel Test in the PHP World (phpbnl10)
Passing the Joel Test in the PHP World (phpbnl10)Passing the Joel Test in the PHP World (phpbnl10)
Passing the Joel Test in the PHP World (phpbnl10)Lorna Mitchell
 
How to establish ways of working that allows shifting-left of the automation ...
How to establish ways of working that allows shifting-left of the automation ...How to establish ways of working that allows shifting-left of the automation ...
How to establish ways of working that allows shifting-left of the automation ...Max Barrass
 
An almost complete continuous delivery pipeline including configuration manag...
An almost complete continuous delivery pipeline including configuration manag...An almost complete continuous delivery pipeline including configuration manag...
An almost complete continuous delivery pipeline including configuration manag...ulfmansson
 
RandomTest - Random Software Integration Tests That Just Work for C/C++, Java...
RandomTest - Random Software Integration Tests That Just Work for C/C++, Java...RandomTest - Random Software Integration Tests That Just Work for C/C++, Java...
RandomTest - Random Software Integration Tests That Just Work for C/C++, Java...dcieslak
 
Automated Performance Testing
Automated Performance TestingAutomated Performance Testing
Automated Performance TestingLars Thorup
 
Release & Iterate Faster: Stop Manual Testing
Release & Iterate Faster: Stop Manual TestingRelease & Iterate Faster: Stop Manual Testing
Release & Iterate Faster: Stop Manual TestingDrew Hannay
 
Improve the deployment process step by step
Improve the deployment process step by stepImprove the deployment process step by step
Improve the deployment process step by stepDaniel Fahlke
 
Cloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud PipelinesCloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud PipelinesLars Rosenquist
 
Cloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud PipelinesCloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud PipelinesLars Rosenquist
 
Working process and git branch strategy
Working process and git branch strategyWorking process and git branch strategy
Working process and git branch strategyKan-Han (John) Lu
 
Automated Testing of Web Applications
Automated Testing of Web ApplicationsAutomated Testing of Web Applications
Automated Testing of Web Applicationsjonatankronqvist
 
Expedia 3x3 presentation
Expedia 3x3 presentationExpedia 3x3 presentation
Expedia 3x3 presentationDrew Hannay
 
QA Strategies for Testing Legacy Web Apps
QA Strategies for Testing Legacy Web AppsQA Strategies for Testing Legacy Web Apps
QA Strategies for Testing Legacy Web AppsRainforest QA
 
STX Next - Scrum Development Process Overview
STX Next - Scrum Development Process OverviewSTX Next - Scrum Development Process Overview
STX Next - Scrum Development Process OverviewSTX Next
 
Beyond unit tests: Deployment and testing for Hadoop/Spark workflows
Beyond unit tests: Deployment and testing for Hadoop/Spark workflowsBeyond unit tests: Deployment and testing for Hadoop/Spark workflows
Beyond unit tests: Deployment and testing for Hadoop/Spark workflowsDataWorks Summit
 
A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5SSW
 

Similar to Yet Another CI Story: Continuous Integration at a Startup (20)

Unit testing legacy code
Unit testing legacy codeUnit testing legacy code
Unit testing legacy code
 
Code review and automated testing for Puppet code
Code review and automated testing for Puppet codeCode review and automated testing for Puppet code
Code review and automated testing for Puppet code
 
High Performance Software Engineering Teams
High Performance Software Engineering TeamsHigh Performance Software Engineering Teams
High Performance Software Engineering Teams
 
Passing the Joel Test in the PHP World (phpbnl10)
Passing the Joel Test in the PHP World (phpbnl10)Passing the Joel Test in the PHP World (phpbnl10)
Passing the Joel Test in the PHP World (phpbnl10)
 
How to establish ways of working that allows shifting-left of the automation ...
How to establish ways of working that allows shifting-left of the automation ...How to establish ways of working that allows shifting-left of the automation ...
How to establish ways of working that allows shifting-left of the automation ...
 
An almost complete continuous delivery pipeline including configuration manag...
An almost complete continuous delivery pipeline including configuration manag...An almost complete continuous delivery pipeline including configuration manag...
An almost complete continuous delivery pipeline including configuration manag...
 
RandomTest - Random Software Integration Tests That Just Work for C/C++, Java...
RandomTest - Random Software Integration Tests That Just Work for C/C++, Java...RandomTest - Random Software Integration Tests That Just Work for C/C++, Java...
RandomTest - Random Software Integration Tests That Just Work for C/C++, Java...
 
Automated Performance Testing
Automated Performance TestingAutomated Performance Testing
Automated Performance Testing
 
Release & Iterate Faster: Stop Manual Testing
Release & Iterate Faster: Stop Manual TestingRelease & Iterate Faster: Stop Manual Testing
Release & Iterate Faster: Stop Manual Testing
 
Improve the deployment process step by step
Improve the deployment process step by stepImprove the deployment process step by step
Improve the deployment process step by step
 
Cloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud PipelinesCloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud Pipelines
 
Cloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud PipelinesCloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud Pipelines
 
Working process and git branch strategy
Working process and git branch strategyWorking process and git branch strategy
Working process and git branch strategy
 
Integration testing - A&BP CC
Integration testing - A&BP CCIntegration testing - A&BP CC
Integration testing - A&BP CC
 
Automated Testing of Web Applications
Automated Testing of Web ApplicationsAutomated Testing of Web Applications
Automated Testing of Web Applications
 
Expedia 3x3 presentation
Expedia 3x3 presentationExpedia 3x3 presentation
Expedia 3x3 presentation
 
QA Strategies for Testing Legacy Web Apps
QA Strategies for Testing Legacy Web AppsQA Strategies for Testing Legacy Web Apps
QA Strategies for Testing Legacy Web Apps
 
STX Next - Scrum Development Process Overview
STX Next - Scrum Development Process OverviewSTX Next - Scrum Development Process Overview
STX Next - Scrum Development Process Overview
 
Beyond unit tests: Deployment and testing for Hadoop/Spark workflows
Beyond unit tests: Deployment and testing for Hadoop/Spark workflowsBeyond unit tests: Deployment and testing for Hadoop/Spark workflows
Beyond unit tests: Deployment and testing for Hadoop/Spark workflows
 
A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5
 

Recently uploaded

Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 

Recently uploaded (20)

Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 

Yet Another CI Story: Continuous Integration at a Startup

  • 2. Who I Am ● Anton Serdyuk ● Technical Leader at Startup Labs, Inc. ● anton.serdyuk@gmail.com ● anton.serdyuk@itstartuplabs.com ● @anton_serdyuk ● Skype: serdyuk.anton
  • 4. Disclaimer Projects are different ● Technical requirements ● Business requirements ● Length ● Budget ● Load ● Data size ● etc
  • 5. Disclaimer Teams are different ● Level ● Size ● Structure ● etc
  • 6. Disclaimer There is no silver bullet ● Worked for us != will work for you ● Adopt patterns and principles rather than the full process
  • 8. Who We Are Project ● b2b system ● Unexpected downtime is very expensive ● Bugs in production are also very expensive because of the reputation loss ● Small amount of traffic (But expensive) ● 1.5 years ● 4-15 developers (+ layout, + qa) ● 15 Gb Database (Grows not very fast)
  • 9. Who We Are Technologies ● PHP 5.4 ● Java 7 ● PostgreSQL ● RabbitMQ
  • 10. Who We Are Frameworks ● Hibernate ● JUnit ● Symfony2 ● Silex ● Behat ● PHPUnit
  • 12. Goals and Principles Agile ● Small changes ● Frequent releases ● Early feedback
  • 13. What Is NOT Our Way
  • 14. What Is NOT Our Way Git Flow
  • 15. What Is NOT Our Way Feature Branches feature1 master feature2
  • 16. What Is NOT Our Way Feature Branches Active feature branches usage example
  • 17. What Is NOT Our Way Release Branches 1.1.x 1.0.x master
  • 18. What Is NOT Our Way master/staging/develop branches develop master
  • 19. What Is NOT Our Way Release Tags v1.1.1 v1.1.2 master
  • 20. What IS Our Way
  • 21. What IS Our Way Continuous Integration ● Push every day ● Build every commit ● Run all tests on every build ● Fix red builds quickly
  • 22. What IS Our Way One Branch master
  • 23. What IS Our Way Branch by Abstraction ● Commit switch-off for this feature ● Develop, integrate ● … your code in production now, but switched-off ● Develop, integrate ● Test ● Switch-on this feature in production
  • 24. What IS Our Way Autotests ● QAs write behat scenarios ● Developers implement ● Every feature covered by behat scenarios ● Great regression tests suite - easy refactoring, less bugs ● + ~100% development cost
  • 25. What IS Our Way Every Build Is Release Candidate ● Do not push if state after commit is not suitable for production
  • 26. What IS Our Way Some Numbers ● ~1000 behat scenarios (unit tests are not counted) ● ~15 minutes build duration ● 2 build servers (Intel Xeon, 32 Gb RAM, SSD) ● 5-6 build agents for tests (VMs) ● 3 build agents for build phase (VMs) ● ~15 builds per day ● 2 releases per week
  • 28. Build Process Overview build automatic tests manual tests load and prod migrate tests production
  • 30. Build Process Use The Same Artifacts build build agent agents artifacts apt repository test test test agents test agents agents agents QA server pre prod prod
  • 31. Build Process Autoconfigure All Environments test test test agents test agents agents agents QA server puppet master pre prod prod tune release engineer (architect/admin)
  • 32. Build Process Deploy by Pressing a Button bamboo test test test agents test agents agents agents QA server pre prod prod
  • 34. Build Phase Goals ● Create artifacts which will be used in all phases ● Run unit tests
  • 35. Build Phase Technologies ● Phing ● Maven ● deb-packages (dpkg-buildpackage) ● PHPUnit ● JUnit
  • 38. Automatic Test Phase Goals ● Run functional tests
  • 39. Automatic Test Phase Deploy to Completely Clean System
  • 40. Automatic Test Phase Run Tests in Parallel agent 1 behat process 1 application 1 agent 2 behat process 2 application 2 ... agent 5 behat process 5 application 5
  • 41. Automatic Test Phase Run Tests in Parallel feature 1 feature 2 job 01 agent 1 feature 3 feature 4 feature 5 job 02 feature 6 agent 2 feature 7 feature 8 job 03 feature 9 ... ... feature 50 feature 51 Job 15 agent 3
  • 42. Automatic Test Phase Run Tests in Parallel github: StartupLabs/behat-partial-runner ● bin/behat --count 15 --current 1 ● bin/behat --count 15 --current 2 ● bin/behat --count 15 --current 3 ● bin/behat --count 15 --current 4 ● bin/behat --count 15 --current 5 ● … ● bin/behat --count 15 --current 15
  • 43. Automatic Test Phase Write Fast Tests ● Continuously speed-up your tests ● Use curl instead of Selenium ● Put initial data directly to DB ● etc
  • 44. Automatic Test Phase Write Fast Tests Merge scenarios which do not modify data Feature: Posts pagination Feature: Posts pagination Background: Background: Given I am logged in as admin Given I am logged in as admin And there is many posts And there is many posts Scenario: Pagination works Scenario: All pagination tests Given I am at the posts list # Scenario: Pagination works Then I should see pagination Given I am at the posts list Then I should see pagination Scenario: Link “last” works Given I am at the posts list # Scenario: Link “last” works When I click at the “last” link When I click at the “last” link Then I should see last page Then I should see last page
  • 45. Automatic Test Phase Write Fast Tests Translate outline to single scenarios with TableNode Feature: Post validation Feature: Post validation Background: Background: Given I am logged in as admin Given I am logged in as admin And I am on post add page And I am on post add page Scenario Outline: Validation works Scenario: Validation works When I enter <value> into <field> Then I should see such errors with such input Then I should see error <error> | field | value | error Examples: | field | value | error | | title | | Can not be empty | | tags | Should be letters | | %%%% | | title | | | Can not be empty | tags | %%%% | Should be letters |
  • 46. Automatic Test Phase Write Fast Tests Parallel test execution @parallel Feature: Login server behat process 1 Background: Given I am registered user alex = alex1 alex = alex2 application behat process 2 | username | alex | | password | 123 | Scenario: I can login Given I am at the login page When I fill form with ● Many problems with race conditions | username | alex | | password | 123 | Then I should be logged in ● Not worked for us :(
  • 48. Manual Test Phase Goals ● Run manual tests ● Place where QA see new functionality
  • 49. Manual Test Phase ● Deploy to completely clean system
  • 50. Load and Prod Migrate Tests
  • 51. Load and Prod Migrate Tests Load Tests Goals ● Catch race conditions ● Catch serious performance degradation when database grows or after adding new functionality
  • 52. Load and Prod Migrate Tests Prod Migrate Tests Goals ● Test migrations on real data ● Test migrations time on real data
  • 53. Load and Prod Migrate Tests ● Migrate load test env to new version ● Rollback migrate test env to production snapshot
  • 55. Deploy to Production ● nb-prod - small production copy used by other teams for integration purposes
  • 57. Problems Red Builds for a Long Time ● QA can not deploy new version to staging ● New commits make new tests red like a snowball ● Nobody knows who are responsible for all those failed tests Solutions: ● If build can not be fixed in 15 minutes - revert commit ● Autoreverts on red builds (?)
  • 58. Problems Long Builds ● Nobody wants to wait green build ● Nobody cares about green build after commit ● Red builds for a long time Solutions: ● Speedup tests ● Parallel build ● Add more build servers
  • 59. Problems Blinking Failures ● Failures are trustless - “it is not my fault - it is blinking, just do rebuild” ● Time consuming Solutions: ● Eliminate them ASAP ● Do not just run “Rebuild failed jobs”
  • 61. Key Points, Again Autotests ● There is no sense in CI without tests ● Easy refactoring ● Less bugs
  • 62. Key Points, Again Fast Builds ● Long builds => More changes => Red builds ● Fast tests ● Parallel run ● Hacks in tests ● etc
  • 63. Key Points, Again One branch ● There are no builds from other branches ● There are no hotfixes ● Easy deploy and build pipeline
  • 64. Todo
  • 65. Todo ● Rollback strategy ● Use Bamboo deployment
  • 66. Inspired By ● Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation (Jez Humble, David Farley) ● http://timothyfitz.com/