myheritage - test automation in a continuous deployment environment

34
Matan Goren and Yehuda Miller QA Engineers Test Automation in a Continuous Deployment Environment

Upload: matangoren

Post on 17-Aug-2015

179 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: MyHeritage - Test Automation in a Continuous Deployment Environment

Matan Goren and Yehuda MillerQA Engineers

Test Automation in a Continuous Deployment Environment

Page 2: MyHeritage - Test Automation in a Continuous Deployment Environment

• More than 80 million registered users• 28 million family trees• Website, mobile apps (iOS and Android), desktop

apps (windows and Mac)• 2.5 billion profiles (names in family trees)• 4.5 billion historical documents and records.

Including the world’s largest collection of newspapers

• 200 million photos• 42 languages• 215 employees

Who we are

Page 3: MyHeritage - Test Automation in a Continuous Deployment Environment

Where we were• All manual QA

• Repetitive tasks• Time consuming

• Two service packs a week• Holding back development• SPC size limits error handling

Page 4: MyHeritage - Test Automation in a Continuous Deployment Environment

• Number of tests • Desktop: 538 (469)• Mobile-web 50 (0)

• Runtime of full suite: 37 min (51 min)• RND size

• Number of testers: 13 (7 automations)• Developers: 50

• Grids: 4 (1)• Tests run on prod and semi staging

env.• Continuous Deployment

Where we are today:

Page 5: MyHeritage - Test Automation in a Continuous Deployment Environment

Gray Area for full image

“You don't have to be a genius or a visionary or even a college graduate to be successful. You just need a framework and a dream.”- Michael Dell

Page 7: MyHeritage - Test Automation in a Continuous Deployment Environment

• Easy language for inexperienced developers

• Open source community is very active• It ain’t Java!

Ruby

Page 8: MyHeritage - Test Automation in a Continuous Deployment Environment

• Native to Ruby• Cleaner than Selenium• Adds methods not native to Selenium

• “Being able to select an element by a explicit identifier” –watirmelon.com

Watir-webdriver

Page 9: MyHeritage - Test Automation in a Continuous Deployment Environment

Selenium:

Watir:

Why Watir is cleaner!

Page 10: MyHeritage - Test Automation in a Continuous Deployment Environment

• Provides a simple interface to the define and interact with elements on a page.

• Works with both Watir and Selenium.• Simple way of introducing OOP without a

lot of technical knowledge required• Page factory module handles common

page classes action.

Page-Object gem

Page 11: MyHeritage - Test Automation in a Continuous Deployment Environment

• BDD tool• Tests are written in plain English

• Makes for easy debugging• Easy move from Manual test to automatic test

• Helps soften the introduction to programming• “Top down” programming

• Write a step• Define the step• Make it work

• Pre and post test hooks

Cucumber.io

Page 12: MyHeritage - Test Automation in a Continuous Deployment Environment

Cucumber Feature

Directly with Watir-WebdriverUsing page-object

Tags specify the suites

Page 13: MyHeritage - Test Automation in a Continuous Deployment Environment

Step DefinitionsDirectly with Watir-Webdriver

Using page-object

Page 14: MyHeritage - Test Automation in a Continuous Deployment Environment

Page-object example

Using page-object

Defining page-object

Verify page loaded with page-object

Page 15: MyHeritage - Test Automation in a Continuous Deployment Environment

• Homegrown tool• Takes a given suite and distributes the test

across several groups• Utilizes open-source code from cucumber

and parallel_tests gems• Multiple reports problem is solved by a

report merger tool that was developed in house.

Grid Grouper

Page 16: MyHeritage - Test Automation in a Continuous Deployment Environment

• Chuck Norris!• Was already in use by RND• Open source (lot’s of available plugins)• Schedule automated builds• Kick off manual builds with a few clicks

• Control build parameters (server, suite, etc).• Can build in any of our environments with any

combination of tags• Holds build history for a specified amount of time• Merged report is stored in each build.• HipChat and email notifications

Jenkins

Page 17: MyHeritage - Test Automation in a Continuous Deployment Environment

Daily Build

Page 18: MyHeritage - Test Automation in a Continuous Deployment Environment

Merged Report

Page 19: MyHeritage - Test Automation in a Continuous Deployment Environment

Failed scenario

Page 20: MyHeritage - Test Automation in a Continuous Deployment Environment

• Comprised of Selenium Grid and Selenium-Grid-Extras

• Selenium-Grid-Extras makes the basic setup streamlined

• Gives extra features such as:• Pulling in updated drivers for all browsers• Also for Selenium itself

The Grids

Page 21: MyHeritage - Test Automation in a Continuous Deployment Environment

• We have 4 grids• Each grid has 4 VMs• The VMs include 1 hub-node and 3 other nodes• The hubs are Jenkins slaves• Each node can run 4 parallel tests on Chrome

• One grid is dedicated to CD• We can pull a grid “offline” for testing infra upgrades• Ability to have multiple test runs in parallel on different

environments and tags• Only runs through Jenkins

• Jenkins selects grids automatically based on availability and run history

How we use the grids

Page 22: MyHeritage - Test Automation in a Continuous Deployment Environment

“How long does it take you to get one line of code into production?” - Wisdom of the Internet ;)

Page 23: MyHeritage - Test Automation in a Continuous Deployment Environment

• We moved to CD in the last 6 months• On average we distribute code to

production 20 times per day.• Comes with challenges• Automated test on every code release• Only minimal tests on each release• Dev is responsible to run appropriate tests

PRE-RELEASE in staging

The CD mindset

Page 24: MyHeritage - Test Automation in a Continuous Deployment Environment

• Risk reduction to production• Small incremental changes are easier to

monitor and revert in necessary• Has lower impact on the system

• Increasing R&D velocity• Avoiding wasted time on merges and complex

coordination before dist.• Allow R&D and product to experiment and

innovate more frequently.

RND Goals

Page 25: MyHeritage - Test Automation in a Continuous Deployment Environment

• Provide a safety net• Avoid the bottleneck of manual sanity

testing• Reliability

• No flaky tests• No false failures

• QA E2E test should not be the new bottleneck

QA Goals

Page 26: MyHeritage - Test Automation in a Continuous Deployment Environment

• QA are responsible for E2E tests only.• Dev write and maintain Unit tests• E2E tests are written during development

process • All QA members monitor CD suite results.• CD E2E tests are NOT acceptance tests

Responsibilities

Page 27: MyHeritage - Test Automation in a Continuous Deployment Environment

• CD flow from commit to prod is ~25 minutes

• Current QA CD suite takes 1.5 minute in best case scenario.

• Runs in parallel to some of the jobs in the CD flow• Limited by time frame of parallel jobs• Still have room for further growth

Timing

Page 28: MyHeritage - Test Automation in a Continuous Deployment Environment

• Minimal suite – No full regression on commit

• Occasional false failures due to env/site performance/human error

Risks

Page 29: MyHeritage - Test Automation in a Continuous Deployment Environment

• Reliability• Velocity of tests• Pinpointing the failure• CD halt on failure.• Large scale tests refactoring due to

changes.

Challenges of CD

Page 30: MyHeritage - Test Automation in a Continuous Deployment Environment

“A challenge only becomes an obstacle when you bow to it.” - Ray A. Davis

Page 31: MyHeritage - Test Automation in a Continuous Deployment Environment

• Maintaining production data integrity• Reliance on pre-existing data• Running on local staging env• Fast adaptation to feature flags• Identifying failure reasons• Need a true BDD/TDD mindset

Challenges QA faces

Page 32: MyHeritage - Test Automation in a Continuous Deployment Environment

• Testing on more browsers• IE• Spartan• Firefox

• Suites for our native apps• iOS• Android

• Upgrading the infra• Gems, grids, Ruby…

The road ahead…

Page 33: MyHeritage - Test Automation in a Continuous Deployment Environment

Questions?

Page 34: MyHeritage - Test Automation in a Continuous Deployment Environment

AA Milne

Thanks!We are hiring