worker/worker.js now exports PulseWorker and starts only when it's run directly. Running it as a service behaves exactly as before, so CT 153 needs no redeploy.
tests/worker.test.js adds 7 tests with no server involved:
success returns stdout, stderr and duration;
a failure returns its exit code and output;
a timeout kills the command and reports timed_out with SIGTERM;
at capacity, the worker rejects at once instead of staying silent;
a slot is freed after a failure;
ping is answered with pong;
nothing is sent while disconnected.
Coverage floors
Jest now fails if coverage drops below today's levels:
lib/: 90% of statements and lines, 80% of branches and functions;
worker/: 40% (the connect and heartbeat code isn't unit-tested yet).
I checked that it works: raising the worker floor to 50% fails the run. Jest also ignores tests/ui and tests/integration explicitly.
SBOM
The audit job writes a CycloneDX 1.5 SBOM of the production dependencies (96 components) and keeps it for 90 days as the sbom-cyclonedx artifact of each main build. No job or check names change.
Locally: jest 74/74, lint has 0 errors, actionlint is clean.
Part of #45 (phases 3 and 4).
## Worker unit tests
- `worker/worker.js` now exports `PulseWorker` and starts only when it's run directly. Running it as a service behaves exactly as before, so **CT 153 needs no redeploy**.
- `tests/worker.test.js` adds 7 tests with no server involved:
- success returns stdout, stderr and duration;
- a failure returns its exit code and output;
- a timeout kills the command and reports `timed_out` with `SIGTERM`;
- at capacity, the worker rejects at once instead of staying silent;
- a slot is freed after a failure;
- ping is answered with pong;
- nothing is sent while disconnected.
## Coverage floors
Jest now fails if coverage drops below today's levels:
- `lib/`: 90% of statements and lines, 80% of branches and functions;
- `worker/`: 40% (the connect and heartbeat code isn't unit-tested yet).
I checked that it works: raising the worker floor to 50% fails the run. Jest also ignores `tests/ui` and `tests/integration` explicitly.
## SBOM
The audit job writes a CycloneDX 1.5 SBOM of the production dependencies (96 components) and keeps it for 90 days as the `sbom-cyclonedx` artifact of each `main` build. No job or check names change.
Locally: jest 74/74, lint has 0 errors, actionlint is clean.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
- worker/worker.js exports PulseWorker and starts only when run directly
(no behaviour change for the service; CT 153 needs no redeploy).
- tests/worker.test.js: success, exit code and stderr, timeout kill,
capacity rejection, slot release after failure, ping/pong, no sends
while disconnected.
- jest coverage floors (ratchet at today's levels): lib/ 90% lines and
statements, 80% branches and functions; worker/ 40%.
- The audit job writes a CycloneDX SBOM of production dependencies and
keeps it 90 days for each main build.
Part of #45 phases 3 and 4.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under load a new worker's first heartbeat marked it online before its
WebSocket had connected, so a test's first command was refused, and the
cleanup in finally then threw its own error and hid the real one.
startWorker now waits until the server accepts a probe command for the
worker, and cleanup never throws (offline status has its own test).
Reproduced 1 in 6 under UI-test load before; 0 in 10 after.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jared
merged commit 1474b0aa3f into main2026-11-22 16:01:39 -05:00
jared
deleted branch ci-sbom-worker-tests2026-11-22 16:01:40 -05:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part of #45 (phases 3 and 4).
Worker unit tests
worker/worker.jsnow exportsPulseWorkerand starts only when it's run directly. Running it as a service behaves exactly as before, so CT 153 needs no redeploy.tests/worker.test.jsadds 7 tests with no server involved:timed_outwithSIGTERM;Coverage floors
Jest now fails if coverage drops below today's levels:
lib/: 90% of statements and lines, 80% of branches and functions;worker/: 40% (the connect and heartbeat code isn't unit-tested yet).I checked that it works: raising the worker floor to 50% fails the run. Jest also ignores
tests/uiandtests/integrationexplicitly.SBOM
The audit job writes a CycloneDX 1.5 SBOM of the production dependencies (96 components) and keeps it for 90 days as the
sbom-cyclonedxartifact of eachmainbuild. No job or check names change.Locally: jest 74/74, lint has 0 errors, actionlint is clean.
🤖 Generated with Claude Code