forked from molecule-ai/molecule-core
Closes #790. Depends on feat/issue-583-1-checkpoint-persistence (PR #788). Platform (Go) — checkpoints_integration_test.go (5 new tests): 1. ThreeStepPersistence: POST task_receive/llm_call/task_complete → GET returns all 3 in step_index DESC order with correct names and payloads. 2. CrashResume_HighestStepIsResumptionPoint: POST steps 0+1 only (crash before step 2) → GET shows step_index=1 as the resume point; task_complete absent. 3. UpsertIdempotency_LatestPayloadWins: POST same (wf_id, step_name) twice with different payloads → List returns only the second payload (ON CONFLICT DO UPDATE). 4. PostCascadeDelete_Returns404: simulate post ON-DELETE-CASCADE state (empty rows) → List returns 404 as expected after workspace deletion. 5. AuthGate_NoToken_Returns401: router-level test with WorkspaceAuth middleware; POST/GET/DELETE all return 401 without a bearer token (no DB calls made). workspace-template — _save_checkpoint + 4 Python tests: - Add async _save_checkpoint() to temporal_workflow.py: POST to the platform checkpoint endpoint after each activity stage; fully non-fatal (try/except inside the function, plus defence-in-depth try/except at every call site). - 4 new pytest cases (test_temporal_workflow.py): - nonfatal_on_http_error: _save_checkpoint raises HTTPStatusError (500) → task_receive_activity still returns {"status":"received"}. - nonfatal_on_network_error: _save_checkpoint raises ConnectError → llm_call_activity still returns success LLMResult. - success_path: _save_checkpoint no-op → activity returns correctly; checkpoint called with correct args. - standalone_http_error_is_swallowed: real _save_checkpoint function swallows HTTP 500 from a mocked httpx.AsyncClient; returns None. All 36 temporal workflow Python tests pass. Go tests: Go binary not in this container; test file verified for syntax and against the sqlmock patterns used throughout the handlers package. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| cmd/server | ||
| internal | ||
| migrations | ||
| pkg/provisionhook | ||
| Dockerfile | ||
| Dockerfile.tenant | ||
| entrypoint-tenant.sh | ||
| go.mod | ||
| go.sum | ||