Skip to content

bywatersolutions/bywater-stress-testers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Koha Stress Tester

This repository contains k6 scripts for stress testing Koha and Aspen Discovery.

Installation

You need k6 installed to run these tests.

Mac

Using Homebrew:

brew install k6

Linux

Debian/Ubuntu:

sudo gpg -k
sudo gpg --no-default-keyring --keyring /usr/share/keyrings/k6-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C5AD17C747E3415A3642D57D77C6C491B6C8DA84
echo "deb [signed-by=/usr/share/keyrings/k6-archive-keyring.gpg] https://dl.k6.io/deb stable main" | sudo tee /etc/apt/sources.list.d/k6.list
sudo apt-get update
sudo apt-get install k6

Aspen Discovery Stress Test

The aspen_discovery.js script simulates user traffic on an Aspen Discovery interface. It searches for random words from words_alpha.txt, clicks on results, and navigates back.

Usage

k6 run aspen_discovery.js

Environment Variables

You can configure the test using the following environment variables:

Variable Description Default
URL The base URL of the Aspen Discovery instance. http://aspen-discovery.localhost
RESULTS_TO_CLICK The number of search results to interact with per search. 5
VUS The number of Virtual Users to simulate. 1
ITERATIONS The number of iterations to run per VU. 1

Example:

k6 run -e URL=https://my-aspen-catalog.org -e RESULTS_TO_CLICK=3 aspen_discovery.js

Koha Stress Test

The koha.js script simulates staff activity on the Koha staff interface and OPAC searches. It performs the following actions:

  1. Logs in to the staff interface.
  2. Creates a stub patron, biblio, and item via the API.
  3. Checks the item in, checks it out to the patron, and checks it in again.
  4. Performs a search on the OPAC.
  5. Deletes the created test data.

Usage

k6 run koha.js

Environment Variables

Variable Description Default
STAFF_URL The URL of the Koha staff interface. http://kohadev-intra.localhost
OPAC_URL The URL of the Koha OPAC. http://kohadev.localhost
STAFF_USER The username for the staff interface login. koha
STAFF_PASS The password for the staff interface login. koha
VUS The number of Virtual Users to simulate. 1
ITERATIONS The number of iterations to run per VU. 1

Example:

k6 run -e STAFF_URL=http://staff.mylibrary.org -e STAFF_USER=admin -e STAFF_PASS=secret koha.js

About

K6 scripts for stress testing web applications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published