MCPcopy Create free account
hub / github.com/dtormoen/tsk-tsk / test_mark_complete

Function test_mark_complete

src/context/task_storage.rs:735–761  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

733
734 #[tokio::test]
735 async fn test_mark_complete() {
736 let ctx = AppContext::builder().build();
737 let tsk_env = ctx.tsk_env();
738 let db_path = tsk_env.data_dir().join("test_mark_complete.db");
739 let storage = TaskStorage::new(db_path).unwrap();
740
741 let task = Task {
742 id: "comp1234".to_string(),
743 repo_root: tsk_env.data_dir().to_path_buf(),
744 branch_name: "tsk/fix/comp-task/comp1234".to_string(),
745 copied_repo_path: Some(tsk_env.data_dir().to_path_buf()),
746 ..Task::test_default()
747 };
748 storage.add_task(task).await.unwrap();
749
750 // First mark running, then complete
751 storage.mark_running("comp1234").await.unwrap();
752 let updated = storage
753 .mark_complete("comp1234", "tsk/fix/new-branch/comp1234")
754 .await
755 .unwrap();
756 assert_eq!(updated.status, TaskStatus::Complete);
757 assert!(updated.completed_at.is_some());
758 assert_eq!(updated.branch_name, "tsk/fix/new-branch/comp1234");
759 // started_at should be preserved from mark_running
760 assert!(updated.started_at.is_some());
761 }
762
763 #[tokio::test]
764 async fn test_mark_failed() {

Callers

nothing calls this directly

Calls 6

tsk_envMethod · 0.80
data_dirMethod · 0.80
add_taskMethod · 0.80
mark_runningMethod · 0.80
mark_completeMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected