-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_test.sh
More file actions
executable file
·54 lines (45 loc) · 1.18 KB
/
run_test.sh
File metadata and controls
executable file
·54 lines (45 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
# Simple Load Testing Script
set -e
K6_CONTAINER="demo_k6"
check_container() {
if ! docker ps --format '{{.Names}}' | grep -q "^${K6_CONTAINER}$"; then
echo "Error: k6 container not running. Start with: docker-compose up -d"
exit 1
fi
}
smoke() {
echo "Running Smoke Test..."
docker exec -it ${K6_CONTAINER} k6 run /scripts/smoke.js
}
baseline() {
echo "Running Baseline Test..."
docker exec -it ${K6_CONTAINER} k6 run /scripts/capacity.js
}
stepped() {
echo "Running Stepped Baseline Test (EXTREME)..."
docker exec -it ${K6_CONTAINER} k6 run /scripts/baseline_stepped.js
}
# Main
check_container
case "${1:-help}" in
smoke)
smoke
;;
baseline)
baseline
;;
stepped)
stepped
;;
*)
echo "Usage: ./run_test.sh [smoke|baseline|stepped]"
echo ""
echo " smoke - Quick sanity check (20 seconds)"
echo " baseline - Smooth ramp: 100→2000 RPS, 50ms work (7 min)"
echo " stepped - Find capacity: 100→3000 RPS by steps, 50ms work (~16 min)"
exit 1
;;
esac
echo ""
echo "Done! View metrics at http://localhost:3000"