test(jobs): runner lifecycle integration tests — claim, start, progress, complete, fail #109
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Ref: docs/WORKERS.md §5
The existing job handler tests cover definition listing, job creation/cancellation, and runner registration, but the runner claim → start → progress → complete/fail flow is untested.
Requirements
Add integration tests for the full runner lifecycle:
TestRunnerClaimJob— Register runner, create pending job, claim it, verify job transitions toclaimedTestRunnerStartAndCompleteJob— Claim → start → progress updates → complete with resultTestRunnerFailJob— Claim → start → fail with error messageTestRunnerClaimWithTags— Runner with[create, linux]claims job requiring[create], runner with[export]cannotTestRunnerClaimNoJobs— Claim when no pending jobs returns empty/404TestRunnerHeartbeat— Verify heartbeat updates runner statusTestRunnerAppendAndGetLogs— Append log entries during job, retrieve viaGET /api/jobs/{id}/logsTestJobTimeout— Job expires, timeout sweeper marks it failedUses existing
newTestServerpattern withRequireRunnerAuthmiddleware.