(wf_id: &str)
| 813 | } |
| 814 | |
| 815 | fn sample_workflow_checkpoint(wf_id: &str) -> crate::orchestration::WorkflowCheckpoint { |
| 816 | use crate::orchestration::{ |
| 817 | StepOutcome, WorkflowCheckpoint, WorkflowStepRecord, WORKFLOW_CHECKPOINT_SCHEMA_VERSION, |
| 818 | }; |
| 819 | let outcome = |id: &str, structured| StepOutcome { |
| 820 | task_id: id.to_string(), |
| 821 | session_id: format!("task-run-{id}"), |
| 822 | agent: "explore".to_string(), |
| 823 | output: format!("out-{id}"), |
| 824 | success: true, |
| 825 | structured, |
| 826 | }; |
| 827 | WorkflowCheckpoint { |
| 828 | schema_version: WORKFLOW_CHECKPOINT_SCHEMA_VERSION, |
| 829 | workflow_id: wf_id.to_string(), |
| 830 | steps: vec![ |
| 831 | WorkflowStepRecord { |
| 832 | task_id: "a".into(), |
| 833 | outcome: outcome("a", None), |
| 834 | }, |
| 835 | WorkflowStepRecord { |
| 836 | task_id: "b".into(), |
| 837 | outcome: outcome("b", Some(serde_json::json!({ "k": 1 }))), |
| 838 | }, |
| 839 | ], |
| 840 | checkpoint_ms: 1_700_000_000_000, |
| 841 | } |
| 842 | } |
| 843 | |
| 844 | #[tokio::test] |
| 845 | async fn test_file_store_workflow_checkpoint_roundtrip() { |
no outgoing calls
no test coverage detected