decrease test build time, not test quality with ca blazemeter

43
World ® ’1 6 Decrease Test Build Time NOT Test Quality Refael Botbol - Services Client Manager - CA Technologies DO5X53E DEVOPS

Upload: ca-technologies

Post on 12-Jan-2017

21 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

World®’16

DecreaseTestBuildTimeNOTTestQualityRefaelBotbol- ServicesClientManager- CATechnologies

DO5X53E

DEVOPS

Page 2: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

2 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

©2016CA.Allrightsreserved.Alltrademarksreferencedhereinbelongtotheirrespectivecompanies.

Thecontentprovidedinthis CAWorld2016presentationisintendedforinformationalpurposesonlyanddoesnotformanytypeofwarranty. The informationprovidedbyaCApartnerand/orCAcustomerhasnotbeenreviewedforaccuracybyCA.

ForInformationalPurposesOnlyTermsofthisPresentation

Page 3: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

3 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Abstract

Today,yourbuildtimeconsistsofmuchmorethanjustthetimeittakesJenkinstobuildyourapplication.Italsoincludesregressiontests,deploymenttodifferentenvironments,andmaybeotherapplicationspecifictasksyouwanttoautomateaspartofyour“build”.

Yourbuildtimecansignificantlyinfluencehowoftenandwhenyoudecidetorunyourbuilds(i.e.whetheryourunyourbuildsweekly,nightly,twiceaday,orjustpercommit).Allofthishasadirectimpactonyourproductivityandefficiency.

Buthowcanyoudecreaseyourtestbuildtimewithouttriggeringadropinproductquality- oreventhenumberoftestsyourun?TakealookatanewapproachtotestautomationwithintheCIprocess,andlearnhowto:• Increasethequantityandtypeoftestsrunwhilereducingyourbuildtime• IncludeyourperformancetestsaspartofyourCIprocesstoidentifyperformance

degradationissuesearlyintheprocess• Shiftleftallthewaytothedeveloper.SeehowdeveloperscancreatetestswithDSLusing

theirexistingJSON/YAMLknowledge

Thissessionwillstartoffwithaninteractivediscussionbeforeturningintoademonstration/hands-onworkshop.Attendeeswantingtoparticipateinhands-onwillrequiretobringtheirownlaptopstoexecutetheexercises.

RefaelBotbol

CATechnologiesServicesClientManager

Page 4: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

4 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Agenda

SAVETIME:BYPARALLELING YOURTESTS

DELEGATE:ENABLEEACH PERSONACONTRIBUTETOTHEEFFORT

FOCUS:CONCENTRATEONBUILDING NOTONMAINTAININGTESTS

SCALE:EXECUTEBUILDSASMANYASYOURBUSINESSREQUIRES

1

2

3

4

REDUCETHEBUILDTESTINGPHASEWHILEINCREASINGTESTCOVERAGE

DEMONSTRATION/WORKSHOP5

Page 5: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

5 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Whichtypeoftestshouldwerun?

§ Functional(API/UI)

§ Regressions

§ CriticalBusinessProcesses

§ Performance

§ Smoketests

Page 6: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

6 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

OpenSourceToolsyouprobablyuseforTesting

§ Functional(API/UI)– Selenium/JMeter/PhantomJS

§ Regressions – Selenium/JMeter/PhantomJS

§ CriticalBusinessProcesses– Gatling/JMeter/Selenium

§ Performance – Gatling/JMeter/Locust/Tsung

§ Smoketests– Selenium/JMeter/Gatling

Page 7: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

7 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Agenda

SAVETIME:BYPARALLELING YOURTESTS

DELEGATE:ENABLEEACHPERSONACONTRIBUTETOTHEEFFORT

FOCUS:CONCENTRATEONBUILDINGNOTONMAINTAININGTESTS

SCALE:EXECUTEBUILDSASMANYASYOURBUSINESSREQUIRES

1

2

3

4

DEMONSTRATION/WORKSHOP5

REDUCETHEBUILDTESTINGPHASEWHILEINCREASINGTESTCOVERAGE

Page 8: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

8 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

TestingLayers• Monitoring• Smoketests• FullscaleperformancetestsProd

• Criticalbusiness processes• PerformancetestsStaging

• FunctionalUI• Functionalbackend• Regressiontests• Criticalbusiness processes

Integration

Page 9: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

9 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Divide,Parallel&Conquer

§ Planyourtestsperlayerandparallelasmuchaspossible

§ Stopthebuildonceadesignatedcriticaltesthasfailedand…– Notifythedeveloperregardingtheissue– Freeresourcesforotherbuilds

§ Buildonce,runmany(evenwhenaddingnewtests)

Page 10: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

10 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

DSLbasedTestCreationusingYAMLinTaurus

Page 11: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

11 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

DescribeTestExecutionScenario

Page 12: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

12 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

DescribeTestExecutionScenario

Page 13: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

13 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

SetPass/FailCriteria

Page 14: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

14 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

SAVETIME:BYPARALLELINGYOURTESTS

DELEGATE:ENABLEEACH PERSONACONTRIBUTETOTHEEFFORT

FOCUS:CONCENTRATEONBUILDINGNOTONMAINTAININGTESTS

SCALE:EXECUTEBUILDSASMANYASYOURBUSINESSREQUIRES

1

2

3

4

REDUCETHEBUILDTESTINGPHASEWHILEINCREASINGTESTCOVERAGE

DEMONSTRATION/WORKSHOP5

Page 15: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

15 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Whocancontributetothebuild’stests?

§ Coders – ByprovidinglowleveltestsforAPI/UIandregressions

§ Testers – Byprovidingsystemwidetestsandregressions

§ Operations – Byprovidingcriticalkeypointsandcreatingtestswithpass/failcriteriaforthem

Page 16: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

16 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Whocancontributetothebuild’stests?

§ Product– Byprovidingpass/failcriteriaforbusinessprocesses

§ Marketers– Bycompletingtheproductviewandprovidingmarketingscenarios

§ Performance – Byimplementingperformancetests

Page 17: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

17 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Thisishowwe(can)doit

§ Coders– UsingcodebasedenginesorevenYML/JSONDSL

§ Testers – TheywouldprobablytellyouhowJ

§ Operations– Automatingthescriptsandprovidingpass/failcriteriatomakesurenothingbreaks

Page 18: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

18 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

TheHow– SurprisingPart

§ Product – Providingpass/failcriteriaforstagingandproductionenvironments(andafterseveralruns,evenfortheintegration..)

§ Marketers – Launchinganewevent?- WhynottestisbyusingaDSLwiththesepages?

§ Performance – Theseguysalreadyhavethescriptsandtheproductionvalues.Theonlythingthatisleft,istoincludeit.

Page 19: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

19 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Coders/TestersExamples

§ AsimpleAPIexample

§ Acomplexscenario

§ Java/Pythonseleniumtests

§ JMeter/Gatlingtests

Page 20: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

20 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Product/OperationsExamples

§ Createtestsandsetcriteria

§ Setpass/failcriteriaperenvironment

§ Easilyincludeitaspartofyourtestexecution

Page 21: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

21 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

MarketingExample

Page 22: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

22 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

AddPerformanceTeststoyourbuild

Page 23: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

23 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Summary

§ First,takeadeepbreath…youhavemadeitsofar,youdeserveitJ

§ WecanuseDSLbasedonYML/JSONtocreatetests

§ Wecanchoosetheflavoroftoolswhichbestsuitsus,andreuseourexistingscripts

§ WecanalsousetheDSLtosetpass/failcriteriaanddescribethetestexecution

Page 24: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

24 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

SAVETIME:BYPARALLELINGYOURTESTS

DELEGATE:ENABLEEACHPERSONACONTRIBUTETOTHEEFFORT

FOCUS:CONCENTRATEONBUILDING NOTONMAINTAININGTESTS

SCALE:EXECUTEBUILDSASMANYASYOURBUSINESSREQUIRES

1

2

3

4

REDUCETHEBUILDTESTINGPHASEWHILEINCREASINGTESTCOVERAGE

DEMONSTRATION/WORKSHOP5

Page 25: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

25 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

BuildOnce– UseMany

§ Option1:Separateeverything– Haveyourscriptsrepresentonetestatatime– HaveoneormoreDSLdescribingtheexecutionperbuildper

environment– HaveoneormoreDSLdescribingthepass/failcriteriaperenvironment

Thisgivesyoumaximumagilityoncontrollingyourbuildtests– Addingtestsisfast– Criteriaareappliedtotestsautomaticallyperenvironment

Page 26: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

26 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

BuildOnce– UseMany

§ Option2:Haveclustersoftests– Groupyourteststogetherbaseontype,functionalityorany

characteristicsthatfitsyou– Attachtherightexecutionandcriteriapergroup

Thisisthebestoptionforspecialprojectssuchas– Anewcampaign– Satelliteprojectswhicharen’tpartofeverybuild– Performancetests

Page 27: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

27 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Option1ExecutionExample

Page 28: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

28 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Option2ClusteredTestExample

Page 29: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

29 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

SAVETIME:BYPARALLELINGYOURTESTS

DELEGATE:ENABLEEACHPERSONACONTRIBUTETOTHEEFFORT

FOCUS:CONCENTRATEONBUILDINGNOTONMAINTAININGTESTS

SCALE:EXECUTEBUILDSASMANYASYOURBUSINESSREQUIRES

1

2

3

4

REDUCETHEBUILDTESTINGPHASEWHILEINCREASINGTESTCOVERAGE

DEMONSTRATION/WORKSHOP5

Page 30: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

30 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

UsetheForce CloudtoScale

§ SometesttypescanconsumeallofyourJenkinsWorker’sresources

§ Sometimes,theamountoftestsissimplytoohighforoneWorker

§ Youshortenedthebuildtimeandnoweveryonewantstobuild…

Page 31: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

31 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

OneWorkertoTestThemAll

§ TheJenkinsWorkerholdsthefilesandconfigurations

§ TheWorkerstartthetestsusingcloudresourcestoscaleit

§ ResultsaretransmittedtobacktotheWorker

§ BasedontheresultstheWorkerdecides:– Lunchingthenextpackoftests– Stoppingthebuildduetobadresults– Markthebuildassuccessfulandcontinuetothenextstep

Page 32: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

32 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

UsetheForce CloudtoScale

Page 33: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

33 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Seleniumgeo-locationscale

Page 34: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

34 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

OneSmallThingBeforeWeGo

Page 35: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

35 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

SAVETIME:BYPARALLELINGYOURTESTS

DELEGATE:ENABLEEACHPERSONACONTRIBUTETOTHEEFFORT

FOCUS:CONCENTRATEONBUILDINGNOTONMAINTAININGTESTS

SCALE:EXECUTEBUILDSASMANYASYOURBUSINESSREQUIRES

1

2

3

4

REDUCETHEBUILDTESTINGPHASEWHILEINCREASINGTESTCOVERAGE

DEMONSTRATION/WORKSHOP5

Page 36: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

36 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

GettingTaurus

§ Overall,weinstallTaurusbyusingpip.

§ InformationperOScanbefoundhere:http://gettaurus.org/install/Installation/

Page 37: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

37 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

GetyourTaurusupandrunning

§ Plugyourflashdrive

§ InstallVirtualBox

§ Installvagrant(.dmg file)

§ Openterminalandcreateafolder

§ Gotothatfolderanddovagrantboxaddmy-Taurus-boxfile:///d:/path/to/taurus/box.box

Page 38: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

38 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

GetyourTaurusupandrunning

§ Onthatfolderdovagrantinit my-Taurus-box

§ Vagrantup

§ Vagrantssh

§ Onceyou’reinsidethevagrant,docdTaurusScript

§ Do:bzt TaurusScenario.yml

Page 39: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

39 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

TheChallenge

1. RunaJMeterscriptwithTaurus

2. Createyourown(simple)YMLDSLfileandrunitwithTaurus

3. RunaGatlingtestwithTaurus

4. ParallelthemJ

5. RunyourYMLDSLwith3differentexecutors(JMeter,GatlingandSelenium)andseethedifferencebetweenthem

6. Use–reporttoseetheBlazeMeter’sreport

Page 40: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

40 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Questions?DO5X53E

Page 41: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

41 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

RecommendedSessions

SESSION# TITLE DATE/TIME

DO5T03PLeadershipPanel:ContinuousDeliveryintheFinancialServicesIndustry

11/16/2016at04:30pm

DO5T14SAnalystKeynote:ContinuousDelivery:MakingDevOpsAwesome

11/17/2016at10:30am

DO5X56SNext-GenerationPerformanceTestingwithBlazeMeter,ServiceVirtualizationandTestDataManagement

11/17/2016at04:30pm

Page 42: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

42 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

MustSeeDemos

ModernizeAppDeliveryIntegratedCDTheater5- DOV501P

DeliverTestDataFasterTestDataManagerTheater5- DOV511P

DeliverBetterAppsServiceVirtualizationTheater5- DOV507P

OrchestrateYourReleaseReleaseAutomationTheater5- DOV513P

Page 43: Decrease Test Build Time, Not Test Quality with CA BlazeMeter

@CAWORLD#CAWORLD ©2016CA.AllRIGHTSRESERVED.43 @CAWORLD#CAWORLD

DevOps– ContinuousDelivery

FormoreinformationonDevOps– ContinuousDelivery,pleasevisit:http://cainc.to/PiTFpu