LOAD IMPACT
Automate Load Testing
with CI Integration
LOAD IMPACT
Robin Gustafsson
CTO, Load Impact Agenda
● Performance testing in DevOps
environment
● Introduction to k6 open source load
testing tool
● Automating load testing with k6, Load
Impact 4.0 and GitLab
LOAD IMPACT
Performance testing is changing
DevOps adoption
Developers are getting involved in performance testing alongside QA
LOAD IMPACT
Performance testing fits into your CI workflow
● Developers can load test
early in the dev cycle
● Load test in parallel with
other types of tests
● CI tool integration
LOAD IMPACT
k6 - Open source load testing tool
● Built for developers & QA
testers
● Built in Go, scripting in JavaScript
ES6
● > 3800 GitHub Stars
● Local & Cloud Execution
● Fits nicely into DevOps
workflows / Automation
pipelines
LOAD IMPACT
k6 execution modes
Local execution
○ Traffic is generated locally, results can be stored locally or
in the cloud (k6 run -o cloud script.js)
Cloud execution
○ Traffic is generated from cloud servers managed by Load
Impact, results are stored in the cloud and analyzed in Load
Impact Insights (k6 cloud script.js)
LOAD IMPACT
Creating load tests for k6
Create user scenario
script(s) locally ● A single .js file defines the whole test
● Tests can also be modular/multi-file
● Use your favorite editor
LOAD IMPACT
Running load tests with k6
Start test locally or in
the cloud using k6 CLI
Create user scenario
script(s) locally
LOAD IMPACT
Automating tests with k6
Create test(s) Run baseline test(s)
Set thresholds for
pass/fail
Setup notifications
Setup automated
execution
Lean back and watch
the blinkin’ lights!
LOAD IMPACT
Automating tests with k6
Create test(s) Run baseline test(s)
● Manually executed tests, find “normal” performance
level
● Tests can be run locally/on your infrastructure or in the
cloud!
LOAD IMPACT
Automating tests with k6
Create test config(s) Run baseline test(s)
Set thresholds for
pass/fail
● Thresholds are set in the .js script, and will be honored
both when executing locally/on your infrastructure, or in
the Load Impact cloud
LOAD IMPACT
Automating tests with k6
Create test config(s) Run baseline test(s)
Set thresholds for
pass/fail
● Notifications can be taken care of by your CI system,
or by loadimpact.com (if you send results there for
storage) Setup notifications
LOAD IMPACT
Automating tests with k6 and GitLab
Create test config(s) Run baseline test(s)
Set thresholds for
pass/fail
Setup notifications
Setup automated
execution in GitLab CI
LOAD IMPACT
Create a GitLab Configuration File
The GitLab Configuration File (YAML file): .gitlab-ci.yml manages the k6 load test job
YAML File
LOAD IMPACTLoad Impact 4.0
k6 + Load Impact Insights + Cloud Execution
LOAD IMPACT
k6 + Load Impact 4.0 summary
k6, Insights & Cloud Execution
● Write test cases as JavaScript (ES6) code
● Store test cases locally, in VCS, on GitHub/GitLab, etc.
● Debug test cases locally, using k6 CLI tool
● Run tests locally or in the Load Impact cloud, using:
○ k6 CLI tool (locally or in the cloud)
○ SaaS UI (in the cloud)
● Integrate with your CI tool: GitLab, Jenkins, CircleCI, etc.
● Store/view/analyze results locally or at loadimpact.com
LOAD IMPACT
Learn More
k6 documentation: https://k6.io (join our slack team! https://k6.io/slack/)
GitHub repo: https://github.com/loadimpact/k6
Insights: https://loadimpact.com/insights/
Load Impact Docs: https://support.loadimpact.com/4.0/
Load Impact Support - support@loadimpact.com
Example project on GitLab: https://gitlab.com/loadimpact/k6-gitlab-example
Note: Load Impact 4.0 is available as a free 30-day trial
LOAD IMPACT
Automate load testing with CI integration
Thank you!

Automating load testing with CI integration slideshare

  • 1.
    LOAD IMPACT Automate LoadTesting with CI Integration
  • 2.
    LOAD IMPACT Robin Gustafsson CTO,Load Impact Agenda ● Performance testing in DevOps environment ● Introduction to k6 open source load testing tool ● Automating load testing with k6, Load Impact 4.0 and GitLab
  • 3.
    LOAD IMPACT Performance testingis changing DevOps adoption Developers are getting involved in performance testing alongside QA
  • 4.
    LOAD IMPACT Performance testingfits into your CI workflow ● Developers can load test early in the dev cycle ● Load test in parallel with other types of tests ● CI tool integration
  • 5.
    LOAD IMPACT k6 -Open source load testing tool ● Built for developers & QA testers ● Built in Go, scripting in JavaScript ES6 ● > 3800 GitHub Stars ● Local & Cloud Execution ● Fits nicely into DevOps workflows / Automation pipelines
  • 6.
    LOAD IMPACT k6 executionmodes Local execution ○ Traffic is generated locally, results can be stored locally or in the cloud (k6 run -o cloud script.js) Cloud execution ○ Traffic is generated from cloud servers managed by Load Impact, results are stored in the cloud and analyzed in Load Impact Insights (k6 cloud script.js)
  • 7.
    LOAD IMPACT Creating loadtests for k6 Create user scenario script(s) locally ● A single .js file defines the whole test ● Tests can also be modular/multi-file ● Use your favorite editor
  • 8.
    LOAD IMPACT Running loadtests with k6 Start test locally or in the cloud using k6 CLI Create user scenario script(s) locally
  • 9.
    LOAD IMPACT Automating testswith k6 Create test(s) Run baseline test(s) Set thresholds for pass/fail Setup notifications Setup automated execution Lean back and watch the blinkin’ lights!
  • 10.
    LOAD IMPACT Automating testswith k6 Create test(s) Run baseline test(s) ● Manually executed tests, find “normal” performance level ● Tests can be run locally/on your infrastructure or in the cloud!
  • 11.
    LOAD IMPACT Automating testswith k6 Create test config(s) Run baseline test(s) Set thresholds for pass/fail ● Thresholds are set in the .js script, and will be honored both when executing locally/on your infrastructure, or in the Load Impact cloud
  • 12.
    LOAD IMPACT Automating testswith k6 Create test config(s) Run baseline test(s) Set thresholds for pass/fail ● Notifications can be taken care of by your CI system, or by loadimpact.com (if you send results there for storage) Setup notifications
  • 13.
    LOAD IMPACT Automating testswith k6 and GitLab Create test config(s) Run baseline test(s) Set thresholds for pass/fail Setup notifications Setup automated execution in GitLab CI
  • 14.
    LOAD IMPACT Create aGitLab Configuration File The GitLab Configuration File (YAML file): .gitlab-ci.yml manages the k6 load test job YAML File
  • 15.
    LOAD IMPACTLoad Impact4.0 k6 + Load Impact Insights + Cloud Execution
  • 16.
    LOAD IMPACT k6 +Load Impact 4.0 summary k6, Insights & Cloud Execution ● Write test cases as JavaScript (ES6) code ● Store test cases locally, in VCS, on GitHub/GitLab, etc. ● Debug test cases locally, using k6 CLI tool ● Run tests locally or in the Load Impact cloud, using: ○ k6 CLI tool (locally or in the cloud) ○ SaaS UI (in the cloud) ● Integrate with your CI tool: GitLab, Jenkins, CircleCI, etc. ● Store/view/analyze results locally or at loadimpact.com
  • 17.
    LOAD IMPACT Learn More k6documentation: https://k6.io (join our slack team! https://k6.io/slack/) GitHub repo: https://github.com/loadimpact/k6 Insights: https://loadimpact.com/insights/ Load Impact Docs: https://support.loadimpact.com/4.0/ Load Impact Support - support@loadimpact.com Example project on GitLab: https://gitlab.com/loadimpact/k6-gitlab-example Note: Load Impact 4.0 is available as a free 30-day trial
  • 18.
    LOAD IMPACT Automate loadtesting with CI integration Thank you!

Editor's Notes