feat: gitea branch lifecycle tests
- gitea: create_branch, delete_branch, list verification on studio/sol
This commit is contained in:
@@ -4311,6 +4311,29 @@ mod gitea_sdk_tests {
|
||||
assert_eq!(org.username, "studio");
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_branch_create_and_delete() {
|
||||
let Some(gitea) = dev_gitea().await else { eprintln!("Skipping: no Gitea+OpenBao"); return; };
|
||||
|
||||
let branch_name = format!("test-branch-{}", &uuid::Uuid::new_v4().to_string()[..8]);
|
||||
|
||||
// Create a branch on studio/sol (mirrored from real repo, has commits)
|
||||
let branch = gitea.create_branch("sol", "studio", "sol", &branch_name, None).await.unwrap();
|
||||
assert_eq!(branch.name, branch_name);
|
||||
|
||||
// List branches — should include our new branch
|
||||
let branches = gitea.list_branches("sol", "studio", "sol").await.unwrap();
|
||||
assert!(branches.iter().any(|b| b.name == branch_name));
|
||||
|
||||
// Delete branch
|
||||
gitea.delete_branch("sol", "studio", "sol", &branch_name).await.unwrap();
|
||||
|
||||
// Verify deleted
|
||||
let branches = gitea.list_branches("sol", "studio", "sol").await.unwrap();
|
||||
assert!(!branches.iter().any(|b| b.name == branch_name),
|
||||
"Branch should be deleted");
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_create_and_close_issue() {
|
||||
let Some(gitea) = dev_gitea().await else { eprintln!("Skipping: no Gitea+OpenBao"); return; };
|
||||
|
||||
Reference in New Issue
Block a user