29
World ® ’1 6 Test Automation across 9 Open Source Tools: Taurus Andrey Pokhilko - Chief Scientist, BlazeMeter - CA Technologies DO5X52L DEVOPS

Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

Embed Size (px)

Citation preview

Page 1: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

World®’16

TestAutomationacross9OpenSourceTools:TaurusAndreyPokhilko- ChiefScientist,BlazeMeter- CATechnologies

DO5X52L

DEVOPS

Page 2: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

2 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

©2016CA.Allrightsreserved.Alltrademarksreferencedhereinbelongtotheirrespectivecompanies.

Thecontentprovidedinthis CAWorld2016presentationisintendedforinformationalpurposesonlyanddoesnotformanytypeofwarranty. The informationprovidedbyaCApartnerand/orCAcustomerhasnotbeenreviewedforaccuracybyCA.

ForInformationalPurposesOnlyTermsofthisPresentation

Page 3: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

3 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Abstract

Inthenotsodistantpast,loadtestingtoolshadoneclearpurpose:togenerateload.Allthetoolscreatedatthattimeansweredthisrequirementperfectly.Therationalehasevolvedaswediscovered,fine-tuned,andextendedaspectsoftheprocess.Now,thetestpreparationstageissocomplexandcrucialthatwespendmoretimepreparingteststhanrunningtheload.Wewanttoseelivetestresultsalongsidethehardwaremonitoringdata.Finally,thepost-testphaserequirescheckingSLAconditions,sendingautomatednotifications,andstoringresultsforfutureanalytics.The'goodold'toolswerenotdesignedwellforsuchabroadusecase.Butitisn'tjustthescopeofworkthathaschanged.Eventhehabitsofthepeoplebuildingtheserviceshavealsochanged.Theyprimarilyusetwotypesoftools:command-linetoolsandWeb2.0services.ThinkhowoftenyouencounterLinux,Git andAnsible,Wget andcURL.Orhowmanyofthesetabs- GmailandAWS,GitHubandSplunk,SalesforceandHubspot,NewRelic andJenkins- youcurrentlyhaveopen?The"cherryontop"isthe"continuous"aspectofmoderndevelopmentprocesses.Teamswanttoautomateallpossiblepartsoftheflow,and,insuchcases,thetestingtoolshouldnaturallyfitintothe"pipelinechain"oftheCImachine.We'releftwithtwopossiblesolutions:modernizingoldtoolsorcreatingnewtoolsfromscratch.Neithersolutionisperfect,bothrequirespendingalotofresourcesonredoingsomethingthathasalreadybeendone.Inthissession,AndreyPokhilkowillexploreathirdapproach- anopensourcehybridtoolcalled"Taurus".Thistoolmeetsthebroadusecasesmentionedabove,whileenablingyoutoutilize'triedandtested'toolsforgeneratingload.Tosuittheuser'shabits,Taurusisasimple-to-learncommand-linetoolthatalsoconnectstoWeb2.0services.Thissessionwillhaveahand-onsectionthatwillprovideyouwithanopportunitytocreate,configureandexecuteSeleniumscriptsforperformancetestsintheCloudusingTaurus.

AndreyPokhilkoCATechnologiesChiefScientist,BlazeMeter

Page 4: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

4 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

http://gettaurus.org

Page 5: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

5 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Agenda

WHYLEARNTAURUS?

TAURUSOVERVIEW

9TOOLSSUPPORTED

Q&A

1

2

3

4

Page 6: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

6 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

WhyLearnTaurus?

§ DevOps-styleusageofloadtestingtools(CLI+SaaS)

§ Freedomtochoosetoolthatfitsuse-case

§ Enable“shiftleft”forloadtesting

§ EnableautomationandCIforloadtesting

Page 7: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

7 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Taurusis:

§ Text-basedconfigurationfileformat

§ Executedbythecommand-linetool

§ Thatwrapsexistingloadgeneratingtools

§ AndconnectstoSaaSforreportingandscale

Page 8: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

8 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

YAMLSyntaxIntro

§ Whitespacematters <=mainsourceofmistakes

§ Dictionaries,listsandscalars

§ Noneedtoquotestringsunlessspecialcharsused

§ YAML-awareeditorhelps(Notepad++)

§ IfYAMLdoesnotworkforyou,youcanuseJSONwithTaurus

Page 9: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

9 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

TaurusConfig Structure

§ Scenarios - collectionofscripts

§ Execution - whichscenariosexecuteandhow

§ Reporting - howtoanalyzedata

§ Services - extraactionsondifferentstages

§ Modules - changesettingsforallabove

§ Generalsettings- sometop-leveloptions

Page 10: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

10 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

GoodDefaults

§ Youcanomitalmosteveryoption

§ Almosteverythinghasmeaningfuldefaults

Page 11: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

11 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

WritingFirstConfig

run> bzt first.yml

---execution:- scenario:

requests:- http://blazedemo.com/

Page 12: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

12 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Understandingwhathappensinside

1. Loadconfigs:basedefaults,personalpreferences,config itself

2. GenerateJMXfromYAMLscenario

3. ModifyJMXtointegratewithTaurus

4. RunJMeterasparallelprocess

5. Analyzeresultsandoverwatch JMeter

6. Reportstatsintocommandlineattheend

Page 13: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

13 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

ApplyingSomePressure

---execution:- scenario: blazedemoconcurrency: 10ramp-up: 1mhold-for: 2m

scenarios:blazedemo:requests:- http://blazedemo.com/

Page 14: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

14 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

LearningQuickOverrides

run> bzt first.yml ⇒

-o execution.0.concurrency=20

-o modules.console.disable=true

Page 15: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

15 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

UsingOnlineReports

run> bzt first.yml -report

Page 16: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

16 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

ImportantFilesandDirectories

§ Artifactslocation,configurable,showntwicearun:– merged.yml,effective.yml,logs

... ... ...04:03:26 INFO: Artifacts dir: /tmp/bzt-artifacts/1107-035917... ... ...

Page 17: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

17 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

ScalingWithCloudProvider

run> bzt first.yml –cloudYouwillneedtheAPIkeyin~/.bzt-rc forthis

---execution:- scenario: blazedemoconcurrency: 50hold-for: 5mlocations:us-west-1: 2eu-west-1: 3

Page 18: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

18 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

ScenarioBuilding:DSLinYAML

§ Scenariobuildingisalotspecificforeachtool

§ JMetersupportisthemostrich:– extractors,– assertions,– logic,– config elements– JSR223– threadactions

Page 19: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

19 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

ScenarioBuilding:DSLinYAML

---scenarios:from-script:requests:- url: http://blazedemo.comassert:- Welcome

Page 20: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

20 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

ScenarioBuilding:SourceFiles

---scenarios:from-script:script: my-predefined.jmxmodifications:disable:- Constant Timer

Page 21: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

21 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

9ToolsSupported

§ Somearecross-platform:JMeter,Gatling,Selenium,Grinder,Locust,ab

§ SomeareLinux/Unix-only:Siege,Pbench,Tsung

§ Seleniumisveryspecial:Java,Python,JavaScript,Rubysupported

§ YoucanwriteyourownandplugitintoTaurus

Page 22: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

22 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

SwitchingTools

Available:JMeter,Gatling,Selenium,Grinder,Locust,ab,Siege,Pbench,Tsung

---execution:- scenario: blazedemohold-for: 1mexecutor: gatling

Page 23: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

23 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Taurus• OpenSourceinitiativesponsoredbyCABlazeMeter• Automation-friendlyframeworkforContinuousTesting• DefinescenariosinTaurusYAMLorexecuteexistingtests• Widevarietyoftestexecutors,includingJMeter,Selenium,Gatling,…• Abilitytogenerateloadlocallyorinthecloud• ConsistentreportingthroughTaurusUIorBlazeMeter• EasyintegrationwithContinuousDeliverysystems

Summary

scenarios:home-page:requests:- label: Homeurl: /method: GETthink-time: 500msassert:- contains:- Welcomesubject: bodyregexp: false

Page 24: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

24 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

FreePlayTime!

Page 25: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

25 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Questions?

Page 26: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

26 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

RecommendedSessions

SESSION# TITLE DATE/TIME

DO5T03P FinancialIndustryPanel– Theater5 11/16/2016at04:30pm

DO5X39SGM'sRemovingTestingConstraintswithRespecttoTestModelingandTDM– LagoonL

11/16/2016at04:30pm

DO5X55S WalmartBrasil—SeasonalPeakTrafficReadiness 11/16/2016at04:30pm

Page 27: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

27 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

MustSeeDemos

ModernizeAppDeliveryIntegratedCDTheater5- DOV501P

DeliverTestDataFasterTestDataManagerTheater5- DOV511P

DeliverBetterAppsServiceVirtualizationTheater5- DOV507P

OrchestrateYourReleaseReleaseAutomationTheater5- DOV513P

Page 28: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

28 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Thankyou.

Stayconnectedatcommunities.ca.com

Page 29: Pre-Con Lab: Test Automation Across Nine Open Source Tools—Taurus

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

DevOps– ContinuousDelivery

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