chore(coordinator): add API smoke script and request collection
Two ways to exercise every endpoint, both living in the repo rather than in a personal Postman workspace: - scripts/smoke.sh walks the full lifecycle and asserts each status, exiting non-zero on the first surprise, so it works in CI as well as by hand; - api/requests.http drives the same calls from an editor's REST client, with later requests reusing ids captured from earlier responses. It doubles as API documentation for the worker author. The script claims until it sees its own job's chunks instead of assuming an empty queue: a shared development database usually holds pending tasks from earlier runs, and it takes the attempt number from the claim response, since a task requeued after an expired lease comes back with attempt 2 or 3. Note for whoever extends the validation cases: Go matches JSON field names case-insensitively, so "worker_ID" is accepted as "worker_id". Only a genuinely unknown key trips DisallowUnknownFields.
This commit is contained in:
@@ -63,3 +63,10 @@ rebuild:
|
||||
|
||||
psql:
|
||||
docker compose exec postgres psql -U scimesh -d scimesh
|
||||
|
||||
# --- api ------------------------------------------------------------------
|
||||
# Exercises every endpoint against a running coordinator; exits non-zero on the
|
||||
# first unexpected status. See also api/requests.http for clicking through them
|
||||
# one at a time in an editor.
|
||||
smoke:
|
||||
./scripts/smoke.sh
|
||||
|
||||
Reference in New Issue
Block a user