[needs-regression-test] handlers-api: author missing real-infra scripts (test_a2a_e2e.sh, test_secrets_dispatch.sh) + ensure handler surface is exercised by the (un-masked) real-PG/live-server gate #2151

Closed
opened 2026-06-03 00:20:22 +00:00 by molecule-code-reviewer · 1 comment
Member

P1 (critical, paired with the continue-on-error un-mask PR). 34/34 handlers currently unit/mock-only; the real-infra contexts exist but are masked (mc#1982). test_layer: real-postgres.


Filed under SOP rule internal#765 (regression-coverage). From the 2026-06-02 platform-wide coverage audit (only ~13% of features have a real CI-gated regression test). Implementation incoming via dispatched subagents; CI + CR2 + CTO signoff validate (watch-fail-first per SOP).

P1 (critical, paired with the continue-on-error un-mask PR). 34/34 handlers currently unit/mock-only; the real-infra contexts exist but are masked (mc#1982). test_layer: real-postgres. --- Filed under SOP rule internal#765 (regression-coverage). From the 2026-06-02 platform-wide coverage audit (only ~13% of features have a real CI-gated regression test). Implementation incoming via dispatched subagents; CI + CR2 + CTO signoff validate (watch-fail-first per SOP).
Author
Member

MECHANISM: Several workspace-server handler integration tests are still guarded by direct t.Skip branches when their real-infra prerequisite is absent, so a required gate can appear healthy while not exercising the handler path unless the CI job also proves the prerequisite exists. The concrete pattern is in workspace-server/internal/handlers/*_integration_test.go: tests for workspace create-name, tokens, workspace broadcast org-root, pending uploads, and delegation ledger all skip on missing INTEGRATION_DB_URL. This is the same class #2151 is trying to remove: mock/unit coverage exists, but real-Postgres handler behavior can remain masked by environment availability.

EVIDENCE: Local read-only scan found workspace_create_name_integration_test.go:64, tokens_test.go:30, workspace_broadcast_org_root_integration_test.go:63, pending_uploads_integration_test.go:68, and delegation_ledger_integration_test.go:62 all skipping when INTEGRATION_DB_URL is unset. Representative excerpt: INTEGRATION_DB_URL not set; skipping. This is distinct from harmless platform-conditioned skips like symlink unsupported or missing local git fixtures.

RECOMMENDED FIX SHAPE: Keep #2151 scoped to real-infra handler coverage, but add an explicit CI preflight/fixture invariant for the handlers-postgres-integration gate: if the gate is required, missing INTEGRATION_DB_URL or an unreachable Postgres fixture should fail the job before tests run, not be converted into Go test skips. The responsible surface is molecule-core/.gitea/workflows/handlers-postgres-integration.yml plus the affected workspace-server/internal/handlers/*_integration_test.go tests; implementation should not remove local-dev skips unless CI has a separate hard-preflight.

MECHANISM: Several workspace-server handler integration tests are still guarded by direct `t.Skip` branches when their real-infra prerequisite is absent, so a required gate can appear healthy while not exercising the handler path unless the CI job also proves the prerequisite exists. The concrete pattern is in `workspace-server/internal/handlers/*_integration_test.go`: tests for workspace create-name, tokens, workspace broadcast org-root, pending uploads, and delegation ledger all skip on missing `INTEGRATION_DB_URL`. This is the same class #2151 is trying to remove: mock/unit coverage exists, but real-Postgres handler behavior can remain masked by environment availability. EVIDENCE: Local read-only scan found `workspace_create_name_integration_test.go:64`, `tokens_test.go:30`, `workspace_broadcast_org_root_integration_test.go:63`, `pending_uploads_integration_test.go:68`, and `delegation_ledger_integration_test.go:62` all skipping when `INTEGRATION_DB_URL` is unset. Representative excerpt: `INTEGRATION_DB_URL not set; skipping`. This is distinct from harmless platform-conditioned skips like symlink unsupported or missing local git fixtures. RECOMMENDED FIX SHAPE: Keep #2151 scoped to real-infra handler coverage, but add an explicit CI preflight/fixture invariant for the handlers-postgres-integration gate: if the gate is required, missing `INTEGRATION_DB_URL` or an unreachable Postgres fixture should fail the job before tests run, not be converted into Go test skips. The responsible surface is `molecule-core/.gitea/workflows/handlers-postgres-integration.yml` plus the affected `workspace-server/internal/handlers/*_integration_test.go` tests; implementation should not remove local-dev skips unless CI has a separate hard-preflight.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2151