Skip to content

Instantly share code, notes, and snippets.

scenarios:
# Each virtual user created by Artillery will run one of the scenarios,
# randomly choosing one based on the weight attribute
- name: "Add song to an existing collection"
weight: 5
flow:
- get:
# Defined on ./helpers.js, sets env specific auth headers
beforeRequest: "setAuthorizationHeaders"
url: "/v1/collections"
config:
environments:
# Configure several environments and select which to run through the -e flag
local:
target: "http://localhost:8080"
preproduction:
target: "https://example-api.preproduction.mycorp.internal"
phases:
- duration: 120
arrivalRate: 5
aws s3 cp --recursive s3://$SCENARIOS_S3_BUCKET/$SERVICE/ .
source overwrites.env
npx artillery run --config config.yaml -e $ENVIRONMENT spec.yml
aws s3 cp s3://$SCENARIOS_BUCKET/$SERVICE . --recursive
# Default environment variables
TASK_COUNT=10
source ./overwrites.env # Override TASK_COUNT & others if needed
./setup.sh && echo "Setup script finished." || echo "No setup.sh file found. Continuing..."
PAYLOAD=$( jq -n -c \
--arg tc "$TASK_COUNT" \