diff --git a/services/commtest/tests/backup_performance_test.rs b/services/commtest/tests/backup_performance_test.rs --- a/services/commtest/tests/backup_performance_test.rs +++ b/services/commtest/tests/backup_performance_test.rs @@ -1,3 +1,5 @@ +#[path = "./backup/add_attachments.rs"] +mod add_attachments; #[path = "./backup/backup_utils.rs"] mod backup_utils; #[path = "./backup/create_new_backup.rs"] @@ -90,6 +92,7 @@ } }); + // check if backup IDs are properly set for (i, item) in backup_data.iter().enumerate() { assert!( !item.backup_item.id.is_empty(), @@ -98,6 +101,28 @@ ); } + // ADD ATTACHMENTS - BACKUPS + rt.block_on(async { + println!("performing ADD ATTACHMENTS - BACKUPS operations"); + let mut handlers = vec![]; + for (_, item) in backup_data.iter().enumerate() { + let item_cloned = item.clone(); + let mut client_cloned = client.clone(); + handlers.push(tokio::spawn(async move { + if item_cloned.backup_item.attachments_holders.is_empty() { + return (); + } + add_attachments::run(&mut client_cloned, &item_cloned, None) + .await + .unwrap(); + })); + } + + for handler in handlers { + handler.await.unwrap(); + } + }); + // SEND LOG // ADD ATTACHMENTS // PULL BACKUP