GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - chrispsheehan/performance-test-framework: k6 TypeScript Performance Test Framework

BranchesTags
Open more actions menu

Latest commit

 

History

109 Commits
109 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
mock
mock
 
 
src
src
 
 
state
state
 
 
.gitignore
.gitignore
 
 
AGENTS.md
AGENTS.md
 
 
compose.yaml
compose.yaml
 
 
justfile
justfile
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
readme.md
readme.md
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

Performance Test Framework

These example tests are currently pointed at the local mock service in mock/, which is built and run via Docker Compose.

To target another URI remove the mock service and set the APP_DOMAIN environmental variable within compose.yaml.

This project now uses tsc directly for the k6 test build. Test data generation comes from the k6-native xk6-faker extension rather than a bundled npm Faker package. The local mock service runs native TypeScript on modern Node without a transpile step.

References:

  • TypeScript
  • Grafana k6 docs
  • k6 extensions
  • xk6-faker
  • k6 modules documentation
  • Local mock API: mock/server.ts
  • Local task runner: justfile

Build

Use just for the normal local workflow:

just build

Build code in docker

docker run -i --rm -v ${PWD}/:/app node:20-alpine sh -lc "cd /app && npm ci && npm run build"

Run

  • The below command will;
    • Build and start the target mock API
    • Execute the tests via k6
just smoke

Useful individual steps:

just up
just run
just down

Tags

Tags are used to separate results from one another as documented here.

headers.tags = { tag: "getuser" };

Thresholds

Thresholds are set on a per tag basis as documented here.

  • p(95)<2000 95% of requests to run in 5 seconds or less.
  • rate<=0.01 99% of requests successful.
export let options = {
  
  thresholds: {
    "http_req_duration{tag:getuser}": ['p(95)<10000'],
    "http_req_failed{tag:getuser}": ['rate<=0.01'],

    "http_req_duration{tag:createuser}": ['p(95)<2000'],
    "http_req_failed{tag:createuser}": ['rate<=0.01'],    
  },
};

Gotchas

  • ERROR: no matching manifest for linux/arm64/v8 in the manifest list entries
  • FIX: add platform: linux/x86_64 to the Compose service definition

About

k6 TypeScript Performance Test Framework

Topics

dockerfaker-libraryperformance-testingtest-automationtypescript

Resources

Readme
Activity

Stars

13 stars

Watchers

1 watching

Forks

3 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.