Page MenuHomePhabricator

D13805.id45423.diff
No OneTemporary

D13805.id45423.diff

diff --git a/services/commtest/tests/backup_integration_test.rs b/services/commtest/tests/backup_integration_test.rs
--- a/services/commtest/tests/backup_integration_test.rs
+++ b/services/commtest/tests/backup_integration_test.rs
@@ -8,10 +8,12 @@
auth::UserIdentity,
backup::{LatestBackupIDResponse, UploadLogRequest},
};
+use commtest::identity::device::register_user_device;
use commtest::{
service_addr,
tools::{generate_stable_nbytes, Error},
};
+use grpc_clients::identity::DeviceType;
use reqwest::StatusCode;
use std::collections::HashSet;
use uuid::Uuid;
@@ -20,10 +22,12 @@
async fn backup_integration_test() -> Result<(), Error> {
let backup_client = BackupClient::new(service_addr::BACKUP_SERVICE_HTTP)?;
+ let device_info = register_user_device(None, Some(DeviceType::Ios)).await;
+
let user_identity = UserIdentity {
- user_id: "1".to_string(),
- access_token: "dummy access token".to_string(),
- device_id: "dummy device_id".to_string(),
+ user_id: device_info.user_id.clone(),
+ access_token: device_info.access_token,
+ device_id: device_info.device_id,
};
let backup_datas = generate_backup_data();
@@ -74,7 +78,7 @@
// Test latest backup lookup
let latest_backup_descriptor = BackupDescriptor::Latest {
// Initial version of the backup service uses `user_id` in place of a username
- username: "1".to_string(),
+ username: device_info.user_id.to_string(),
};
let backup_id_response = backup_client
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
@@ -3,10 +3,12 @@
};
use bytesize::ByteSize;
use comm_lib::{auth::UserIdentity, backup::LatestBackupIDResponse};
+use commtest::identity::device::register_user_device;
use commtest::{
service_addr,
tools::{generate_stable_nbytes, obtain_number_of_threads, Error},
};
+use grpc_clients::identity::DeviceType;
use tokio::{runtime::Runtime, task::JoinSet};
#[tokio::test]
@@ -39,16 +41,19 @@
});
}
+ let device_info_1 = register_user_device(None, Some(DeviceType::Ios)).await;
+ let device_info_2 = register_user_device(None, Some(DeviceType::Ios)).await;
+
let user_identities = [
UserIdentity {
- user_id: "1".to_string(),
- access_token: "dummy access token".to_string(),
- device_id: "dummy device_id".to_string(),
+ user_id: device_info_1.user_id.clone(),
+ access_token: device_info_1.access_token,
+ device_id: device_info_1.device_id,
},
UserIdentity {
- user_id: "2".to_string(),
- access_token: "dummy access token".to_string(),
- device_id: "dummy device_id".to_string(),
+ user_id: device_info_2.user_id.clone(),
+ access_token: device_info_2.access_token,
+ device_id: device_info_2.device_id,
},
];

File Metadata

Mime Type
text/plain
Expires
Thu, Oct 31, 2:38 PM (20 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2387274
Default Alt Text
D13805.id45423.diff (2 KB)

Event Timeline