test: add handler test coverage — workspace_crud, mcp_tools, org_layout, hub #860

Merged
devops-engineer merged 4 commits from feat/platform-handler-test-coverage into main 2026-05-13 18:12:08 +00:00

4 Commits

Author SHA1 Message Date
2d68f2c8be chore: drop workspace_dispatchers_test.go — superseded by PR #868 (staging)
Some checks failed
sop-checklist / all-items-acked (pull_request) [info tier:low] acked: 7/7
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 15s
Harness Replays / detect-changes (pull_request) Failing after 16s
Harness Replays / Harness Replays (pull_request) Has been skipped
CI / Detect changes (pull_request) Successful in 45s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 19s
E2E API Smoke Test / detect-changes (pull_request) Successful in 48s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 48s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 47s
qa-review / approved (pull_request) Successful in 15s
security-review / approved (pull_request) Successful in 15s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 41s
sop-checklist-gate / gate (pull_request) Successful in 16s
sop-tier-check / tier-check (pull_request) Successful in 22s
gate-check-v3 / gate-check (pull_request) Successful in 43s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m11s
audit-force-merge / audit (pull_request) Successful in 39s
CI / Python Lint & Test (pull_request) Successful in 12s
CI / Canvas (Next.js) (pull_request) Successful in 21s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 19s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 15s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 12s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2m37s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Failing after 6m4s
CI / Platform (Go) (pull_request) Failing after 6m37s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
CI / all-required (pull_request) Successful in 5s
2026-05-13 18:04:00 +00:00
74864af1fb chore: drop org_layout_test, hub.go, hub_test.go (already in staging with better coverage) 2026-05-13 18:04:00 +00:00
59c573d8de fix(test): mock workspace_auth_tokens in TestState_LegacyWorkspaceNoLiveToken
State handler always calls wsauth.HasAnyLiveToken (queries
workspace_auth_tokens) before the main workspaces query. The legacy
test was missing this mock expectation, causing an unexpected-query
sqlmock error. Add the EXISTS(false) expectation to match the
other State test cases.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-13 18:04:00 +00:00
293e3abcb7 test: add handler test coverage — workspace_crud, mcp_tools, org_layout, hub, a2a queue
Eight test files covering pure functions and handler logic:
- a2a_queue_expiry_test.go: expiry queue TTL and cleanup (88 lines)
- mcp_tools_test.go: extractA2AText parsing edge cases (193 lines)
- org_layout_test.go: childSlot/sizeOfSubtree/childSlotInGrid grid helpers (244 lines)
- plugins_atomic_test.go: tarWalk prefix normalization, symlink filtering,
  nested dirs, dir-entry trailing slash (167 lines)
- workspace_crud_test.go: workspace state/update/delete/CascadeDelete + validators (601 lines)
- workspace_dispatchers_test.go: DispatchWorkspaceRequest handler pure helpers (128 lines)
- ws/hub.go: nil-guard on client.Conn in Hub.Close
- ws/hub_test.go: hub broadcast/send/nil AccessChecker coverage (386 lines)

Note: workspace_delivery_mode_test.go and instructions_test.go were removed
from this PR — they are covered by parallel branches targeting staging
(PR #868 and fix/321-cwe22 respectively).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-13 18:04:00 +00:00