A K6 Multi Scenario template applying some best practices along some examples

Overview

K6-Multi-Scenario-Template

It is a performance testing template that shows how to use K6 to implement a Multi Scenario template applying some best practices along some examples.

Getting Started

Clone the code, install K6 and run the k6_multi_scenario_executor.bat and watch the outcome. then learn the basics of K6, there are some code snippets for the main concepts (lifetime, VUs, Duration, checks, Thresholds, Stages, Executors, Scenarios). And once you are familiar with them, go and look the K6_multi_scenario_template.js file which is the k6 template, and modify it to match your SUT (System Under Test).

Features

The purpose of this project is to show how to put all the K6 techniques together while:

  • Applying some best practices.
  • Enabling a multiple test type execution (load, smoke, soak, stress...)
  • Enabling multiple scenario execution (understanding scenario as one concrete way to interact with a server). Ie, if it is a todo server we would like to:
    • login
    • logout
    • register
    • enter a new task
    • enter several tasks
    • retrieve the tasks for the day
    • delete a task
  • Enabling a secure code without secrets on it, and ready to integrate in a CI-CD pipeline without surprises.
  • Show how to implement the most common tasks (register, login, retrieve token, access REST api, access GraphQL api, retrieve and verify a web page).
  • show how to create and use tags & groups.
  • Show how to mix different Scenario executors (Ramping VUs & Ramping Arrival Rate)

The BackendFlowTest and the BackendReadTest as well as the Setup have been taken from the 'Advanced API Flow' example, located at fabulous example section of k6.io, with some modifications. All the credit is theirs :)

Usage

To try it out, just open a command line with cmd.exe in windows in the root folder and type 'k6_multi_scenario_executor.bat' It should execute the smoke test which will run several scenarios:

  • BackendRead_scenario, will read some information from a k6 test REST endpoint.
  • BackendFlow_scenario, will execute a complex scenario againsta k6 test REST endpoint.
  • Frontend_scenario, will retrieve the k6.io page and check some of its content.
  • GraphQL_scenario, will access the Rick & Morty GraphQL API, retrieve all the human characters and do some checks.

Please note that https://rickandmortyapi.com/ is not meant for testing, so the usage in the code is limited to a single VU, so this does not cause a DOS attack to them. So, please, be kind.

Contribution

If you have an idea or suggestion, create an issue or, even better, implement it in a PR so we can improve it and add more functionality.

Community

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information, see the Swiss Life OSS Code of Conduct.

You might also like...

Tailwind & Next Mentorship Template

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

May 22, 2022

Template to create reactjs component library which will help you to create your dream library.

reactjs-library-template Template to create reactjs component library which will help you to create your dream library. How to use Commands to setup e

Dec 25, 2021

A template to be used for creating js/scss projects and deploy them to github pages

A template to be used for creating js/scss projects and deploy them to github pages

A template to be used for creating js/scss projects and deploy them to github pages

Oct 30, 2022

Low tech template for a reduced carbon impact :seedling:

Enverse minimalist front-end template 🌱 🌱 For all else, use Astro.build 😃 Recomended package manager: pnpm Preact + Typescript + Vite How to use: F

Jan 10, 2022

Obsidian To HTML, A template for building obsidian style notes to a static site

oth (Obsidian To HTML) This is a template for publishing obsidian notes as a static site. The goal of the project is to stay minimal, since this is a

Nov 4, 2022

My discord.js bot template

My discord.js Bot Template This repository is an ongoing project to extract core pieces of the discord.js bots and ecosystems I run into a reusable te

Mar 3, 2022

🚀👩‍🚀This repo contains all the files to follow along and implement a MultiChain NFT MarketPlace! Be sure to watch my Youtube tutorials so you can learn and follow along!

🚀👩‍🚀This repo contains all the files to follow along and implement a MultiChain NFT MarketPlace! Be sure to watch my Youtube tutorials so you can learn and follow along!

Multi-Chain NFT Marketplace 🚀 👩‍🚀 This repo contains all the files to follow along and implement a MultiChain NFT MarketPlace! Be sure to watch my

Jan 5, 2023

:fire: A highly scalable, offline-first foundation with the best developer experience and a focus on performance and best practices.

:fire: A highly scalable, offline-first foundation with the best developer experience and a focus on performance and best practices.

Start your next react project in seconds A highly scalable, offline-first foundation with the best DX and a focus on performance and best practices Cr

Jan 6, 2023

:fire: A highly scalable, offline-first foundation with the best developer experience and a focus on performance and best practices.

:fire: A highly scalable, offline-first foundation with the best developer experience and a focus on performance and best practices.

Start your next react project in seconds A highly scalable, offline-first foundation with the best DX and a focus on performance and best practices Cr

Jan 7, 2023

Some HTML, CSS and JS best practices.

Frontend Guidelines HTML Semantics HTML5 provides us with lots of semantic elements aimed to describe precisely the content. Make sure you benefit fro

Jan 1, 2023

A solid create-remix app, that applies best practices into a clean, batteries included template. SQLite version. Deploys to Fly.io

A solid create-remix app, that applies best practices into a clean, batteries included template. SQLite version. Deploys to Fly.io

Remix Barebones Stack npx create-remix --template dev-xo/barebones-stack A solid create-remix app, that follows community guidelines and applies best

Dec 30, 2022

🦎 A jQuery plugin for extracting the dominant color from images and applying the color to their parent.

🦎 A jQuery plugin for extracting the dominant color from images and applying the color to their parent.

jquery.adaptive-backgrounds.js A simple jQuery plugin to extract the dominant color of an image and apply it to the background of its parent element.

Dec 21, 2022

Scrape data from Instagram without applying for the authenticated API 🎯

scraper-instagram Scrape data from Instagram without applying for the authenticated API. Getting started Prerequisites NodeJS NPM or Yarn Install From

Jan 5, 2023

An IoT bottle that tracks water consumption. Winner of Best Health Hack, MLH's Best Hardware Hack, and QB3's Best Big Data for the Improvement of Health Care Winner at CruzHacks 2022.

An IoT bottle that tracks water consumption. Winner of Best Health Hack, MLH's Best Hardware Hack, and QB3's Best Big Data for the Improvement of Health Care Winner at CruzHacks 2022.

An IoT bottle that tracks water consumption. Winner of Best Health Hack, MLH's Best Hardware Hack, and QB3's Best Big Data for the Improvement of Health Care Winner at CruzHacks 2022.

Jan 21, 2022

:white_check_mark: The Node.js best practices list (March 2021)

:white_check_mark:  The Node.js best practices list (March 2021)

Node.js Best Practices Follow us on Twitter! @nodepractices Read in a different language: CN, BR, RU, PL, JA, EU (ES, FR, HE, KR and TR in progress! )

Jan 9, 2023

A set of best practices for JavaScript projects

A set of best practices for JavaScript projects

中文版 | 日本語版 | 한국어 | Русский | Português Project Guidelines · While developing a new project is like rolling on a green field for you, maintaining it is

Jan 1, 2023

Best practices for modern web development

Web Fundamentals on DevSite Welcome to the new WebFundamentals! An effort to showcase best practices and tools for modern Web Development. What's chan

Dec 30, 2022

An easy-to-read, quick reference for JS best practices, accepted coding standards, and links around the Web

An easy-to-read, quick reference for JS best practices, accepted coding standards, and links around the Web

Feel free to contribute! Where? http://www.jstherightway.org Why? Today we have a bunch of websites running JavaScript. I think we need a place to put

Jan 1, 2023

ES2015 [ES6] cheatsheet containing tips, tricks, best practices and code snippets

es6-cheatsheet A cheatsheet containing ES2015 [ES6] tips, tricks, best practices and code snippet examples for your day to day workflow. Contributions

Jan 2, 2023
Owner
Swiss Life OSS
Swiss Life OSS
Variation-template - Variation is a PSD template that is covered into a web template using HTML5, CSS3, Bootstrapv4.6, JavaScript.

Variation Template Design Variation is a PSD website template. In this project this template is designed with HTML. Deployment This site is deployed a

Bipronath Saha 1 Jan 1, 2022
Take a swig of the best template engine for JavaScript.

NOT MAINTAINED Fork and use at your own risk. Swig Swig is an awesome, Django/Jinja-like template engine for node.js. Features Available for node.js a

Paul Armstrong 3.1k Jan 4, 2023
Semi-embedded JS template engine that supports helpers, filters, partials, and template inheritance. 4KB minzipped, written in TypeScript ⛺

squirrelly Documentation - Chat - RunKit Demo - Playground Summary Squirrelly is a modern, configurable, and blazing fast template engine implemented

Squirrelly 451 Jan 2, 2023
An example project using Node.js to run some common tasks including directory backup

All code from this tutorial as a complete package is available in this repository. If you find this tutorial helpful, please share it with your friend

Alex 11 Sep 28, 2022
The fastest + concise javascript template engine for nodejs and browsers. Partials, custom delimiters and more.

doT Created in search of the fastest and concise JavaScript templating function with emphasis on performance under V8 and nodejs. It shows great perfo

Laura Doktorova 4.9k Dec 31, 2022
Pug – robust, elegant, feature rich template engine for Node.js

Pug Full documentation is at pugjs.org Pug is a high-performance template engine heavily influenced by Haml and implemented with JavaScript for Node.j

Pug 21.1k Dec 30, 2022
eXtensible Template Engine lib for node and the browser

xtemplate High Speed, eXtensible Template Engine lib on browser and nodejs. support async control, inheritance, include, logic expression, custom func

xtemplate 553 Nov 21, 2022
Embedded JS template engine for Node, Deno, and the browser. Lighweight, fast, and pluggable. Written in TypeScript

eta (η) Documentation - Chat - RunKit Demo - Playground Summary Eta is a lightweight and blazing fast embedded JS templating engine that works inside

Eta 682 Dec 29, 2022
Highly opinionated project template for Serverless Framework that follows and applies hexagonal architecture principle to serverless world. Prepared with easy testing in mind.

serverless-hexagonal-template Highly opinionated project template for Serverless Framework that applies hexagonal architecture principles to the serve

Paweł Zubkiewicz 126 Dec 26, 2022
Script Template Fivem in Type Script

fivem-ts ?? A Typescript Template for FiveM ?? This is a basic template for creating a FiveM resource using Typescript. It includes webpack config fil

Vinícius Pereira 3 Jun 11, 2021