elemes/load-test
a2nr 89f0967c3e fix: improve JSON parsing robustness in auth routes and update Locust load test scripts with worker management utilities. 2026-04-17 10:50:46 +07:00
..
README.md feat: add Arduino lesson support, documentation, and load testing utilities with improved CLI feedback 2026-04-11 08:39:57 +07:00
content_parser.py feat: add Arduino lesson support, documentation, and load testing utilities with improved CLI feedback 2026-04-11 08:39:57 +07:00
locustfile.py fix: improve JSON parsing robustness in auth routes and update Locust load test scripts with worker management utilities. 2026-04-17 10:50:46 +07:00
requirements.txt feat: add Arduino lesson support, documentation, and load testing utilities with improved CLI feedback 2026-04-11 08:39:57 +07:00
start_locust_workers.sh fix: improve JSON parsing robustness in auth routes and update Locust load test scripts with worker management utilities. 2026-04-17 10:50:46 +07:00
stop_locust.sh fix: improve JSON parsing robustness in auth routes and update Locust load test scripts with worker management utilities. 2026-04-17 10:50:46 +07:00

README.md

Elemes Load Test

Load test E2E menggunakan Locust yang otomatis di-generate dari folder content/.

Cara Pakai

cd elemes/load-test

# 0. Virtual Environment
python3 -m venv ./env
source ./env/bin/activate

# 1. Install dependency
pip install -r requirements.txt

# 2. Generate test data dari content/
python content_parser.py

# 3. Jalankan Locust (opsional: set VELXIO_HOST jika Velxio bukan di localhost:8001)
export VELXIO_HOST=http://localhost:8001
locust -f locustfile.py

Buka http://localhost:8089, masukkan URL backend Elemes (misalnya http://localhost:5000), lalu mulai test.

File

File Fungsi
content_parser.py Parse content/*.mdtest_data.json + inject token test ke CSV
locustfile.py Locust script (7 task weighted) yang baca test_data.json
test_data.json Auto-generated, jangan di-commit
requirements.txt Dependency (locust)

Test Scenarios (8 Tasks)

# Task Weight Target Deskripsi
1 Browse Lessons 3 Elemes GET /lessons, validasi jumlah lesson
2 View Detail 5 Elemes GET /lesson/{slug}.json, validasi field per tipe
3 Compile C 4 Elemes POST /compile, validasi output vs expected
4 Compile Python 3 Elemes POST /compile, validasi output vs expected
5 Verify Arduino 2 Elemes GET lesson Arduino, validasi JSON structure
6 Complete Flow 2 Both fetch → compile → track-progress
7 Progress Report 1 Elemes Login guru → GET /progress-report.json
8 Compile Arduino 3 Velxio POST /api/compile, validasi hex_content

Re-generate Setelah Tambah Lesson Baru

Setiap kali ada lesson baru di content/, cukup jalankan ulang:

python content_parser.py

test_data.json akan di-update otomatis dan Locust langsung test lesson baru.