Fix load test scenarios, runner, and CI threshold checks

- Add constant-arrival-rate scenarios to all 4 service scripts (api,
  darkwatch, spamshield, voiceprint) to enforce 500 req/s target
- Fix defaultThresholds() to return { thresholds: {...} } so
  http_req_duration and errors thresholds are actually applied
- Rewrite run-all.sh: per-service summary files, proper env var
  passing (DURATION, API_TOKEN), fixed threshold aggregation
- Update CI workflow threshold check jq to match new threshold-results
  structure (.services.<name>.exitCode)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-05-09 10:35:45 -04:00
parent d2097d8930
commit 8506fd17ef
8 changed files with 113 additions and 31 deletions

View File

@@ -217,14 +217,13 @@ jobs:
if: always()
run: |
if [ -f scripts/load-test/reports/threshold-results.json ]; then
FAILURES=$(jq -r '.metrics | to_entries[] | select(.value.passes == false) | .key' scripts/load-test/reports/threshold-results.json)
if [ -n "$FAILURES" ]; then
echo "❌ P99 threshold failures:"
echo "$FAILURES"
FAILURES=$(jq -r '[.services | to_entries[] | select(.value.exitCode != 0) | .key] | join(", ")' scripts/load-test/reports/threshold-results.json 2>/dev/null || echo "")
if [ -n "$FAILURES" ] && [ "$FAILURES" != "" ]; then
echo "❌ Load test failures: $FAILURES"
exit 1
else
echo "✅ All P99 thresholds passed"
echo "✅ All load tests passed"
fi
else
echo "No threshold results file found"
echo "⚠️ No threshold results file found"
fi

View File

@@ -64,14 +64,13 @@ jobs:
if: always()
run: |
if [ -f scripts/load-test/reports/threshold-results.json ]; then
FAILURES=$(jq -r '.metrics | to_entries[] | select(.value.passes == false) | .key' scripts/load-test/reports/threshold-results.json 2>/dev/null || echo "")
if [ -n "$FAILURES" ]; then
echo "❌ P99 threshold failures:"
echo "$FAILURES"
FAILURES=$(jq -r '[.services | to_entries[] | select(.value.exitCode != 0) | .key] | join(", ")' scripts/load-test/reports/threshold-results.json 2>/dev/null || echo "")
if [ -n "$FAILURES" ] && [ "$FAILURES" != "" ]; then
echo "❌ Load test failures: $FAILURES"
exit 1
else
echo "✅ All P99 thresholds passed"
echo "✅ All load tests passed"
fi
else
echo "No threshold results file found"
echo "⚠️ No threshold results file found"
fi