Join our community: https://t.me/+DOylgFv1jyJlNzM0
Why this matters
scripts/loadtest/baseline.js is wired into .github/workflows/loadtest.yml as the project's only load test. It sends unauthenticated GET requests to ${BASE_URL}/api/v1/loans and ${BASE_URL}/api/v1/score/${WALLET_SEED}.
Looking at the routes, GET /loans is behind requireJwtAuth in backend/src/routes/loanRoutes.ts, and the score route is behind requireApiKey in backend/src/routes/scoreRoutes.ts. Neither request in the k6 script sends a JWT or API key, so both calls will always return 401 during every load test run.
The k6 thresholds in baseline.js only check http_req_duration and http_req_failed (network-level failures), not the check() results. A 401 response is a normal HTTP response, not a network failure, so the workflow reports green even though it never actually load-tests the real, authenticated request paths it claims to cover. The load test is effectively measuring 401-response latency, not the borrower/lender flows it is meant to exercise.
Acceptance criteria
Files to touch
scripts/loadtest/baseline.js
.github/workflows/loadtest.yml
Out of scope
- Adding new load test scenarios beyond fixing the existing baseline script's auth and check-gating.
- Changing the auth middleware itself.
Why this matters
scripts/loadtest/baseline.jsis wired into.github/workflows/loadtest.ymlas the project's only load test. It sends unauthenticated GET requests to${BASE_URL}/api/v1/loansand${BASE_URL}/api/v1/score/${WALLET_SEED}.Looking at the routes,
GET /loansis behindrequireJwtAuthinbackend/src/routes/loanRoutes.ts, and the score route is behindrequireApiKeyinbackend/src/routes/scoreRoutes.ts. Neither request in the k6 script sends a JWT or API key, so both calls will always return 401 during every load test run.The k6
thresholdsinbaseline.jsonly checkhttp_req_durationandhttp_req_failed(network-level failures), not thecheck()results. A 401 response is a normal HTTP response, not a network failure, so the workflow reports green even though it never actually load-tests the real, authenticated request paths it claims to cover. The load test is effectively measuring 401-response latency, not the borrower/lender flows it is meant to exercise.Acceptance criteria
scripts/loadtest/baseline.jsobtains valid auth (JWT and/or API key) before hitting protected endpoints, or is repointed at genuinely public endpoints.check()results actually gate pass/fail for the workflow run (e.g. via achecksthreshold or explicit exit-code handling), so silently-failing checks can no longer produce a green run..github/workflows/loadtest.ymldocuments how to supply credentials/env vars needed for the authenticated run.Files to touch
scripts/loadtest/baseline.js.github/workflows/loadtest.ymlOut of scope