diff --git a/services/commtest/tests/backup/pull_backup.rs b/services/commtest/tests/backup/pull_backup.rs --- a/services/commtest/tests/backup/pull_backup.rs +++ b/services/commtest/tests/backup/pull_backup.rs @@ -3,8 +3,8 @@ #[path = "../lib/tools.rs"] mod tools; -use tonic::Request; use std::io::{Error as IOError, ErrorKind}; +use tonic::Request; use crate::backup_utils::{ proto::pull_backup_response::Data, proto::pull_backup_response::Data::*, @@ -63,7 +63,10 @@ "invalid state, expected compaction, got {:?}", state ); - current_id = backup_id.ok_or(IOError::new(ErrorKind::Other, "backup id expected but not received"))?; + current_id = backup_id.ok_or(IOError::new( + ErrorKind::Other, + "backup id expected but not received", + ))?; println!( "compaction (id {}), pushing chunk (size: {})", current_id, @@ -76,7 +79,10 @@ state = State::Log; } assert_eq!(state, State::Log, "invalid state, expected compaction"); - let log_id = log_id.ok_or(IOError::new(ErrorKind::Other, "log id expected but not received"))?; + let log_id = log_id.ok_or(IOError::new( + ErrorKind::Other, + "log id expected but not received", + ))?; if log_id != current_id { result.log_items.push(Item::new( log_id.clone(), diff --git a/services/commtest/tests/backup_test.rs b/services/commtest/tests/backup_integration_test.rs rename from services/commtest/tests/backup_test.rs rename to services/commtest/tests/backup_integration_test.rs --- a/services/commtest/tests/backup_test.rs +++ b/services/commtest/tests/backup_integration_test.rs @@ -20,7 +20,7 @@ use backup_utils::BackupServiceClient; #[tokio::test] -async fn backup_test() -> Result<(), Error> { +async fn backup_integration_test() -> Result<(), Error> { let port = env::var("COMM_SERVICES_PORT_BACKUP") .expect("port env var expected but not received"); let mut client = @@ -61,10 +61,7 @@ // a big item that should be placed in the S3 right away Item::new( String::new(), - vec![ - *tools::GRPC_CHUNK_SIZE_LIMIT, - *tools::GRPC_CHUNK_SIZE_LIMIT, - ], + vec![*tools::GRPC_CHUNK_SIZE_LIMIT, *tools::GRPC_CHUNK_SIZE_LIMIT], vec![ "holder0".to_string(), "holder1".to_string(), @@ -73,6 +70,7 @@ ), ], }; + backup_data.backup_item.id = create_new_backup::run(&mut client, &backup_data).await?; println!("backup id in main: {}", backup_data.backup_item.id); diff --git a/services/commtest/tests/blob_test.rs b/services/commtest/tests/blob_integration_test.rs rename from services/commtest/tests/blob_test.rs rename to services/commtest/tests/blob_integration_test.rs --- a/services/commtest/tests/blob_test.rs +++ b/services/commtest/tests/blob_integration_test.rs @@ -16,7 +16,7 @@ use tools::Error; #[tokio::test] -async fn blob_test() -> Result<(), Error> { +async fn blob_integration_test() -> Result<(), Error> { let port = env::var("COMM_SERVICES_PORT_BLOB") .expect("port env var expected but not received"); let mut client = diff --git a/services/commtest/tests/lib/tools.rs b/services/commtest/tests/lib/tools.rs --- a/services/commtest/tests/lib/tools.rs +++ b/services/commtest/tests/lib/tools.rs @@ -25,8 +25,10 @@ pub const GRPC_METADATA_SIZE_BYTES: usize = 5; lazy_static! { - pub static ref DYNAMO_DB_ITEM_SIZE_LIMIT: usize = ByteSize::kib(400).as_u64() as usize; - pub static ref GRPC_CHUNK_SIZE_LIMIT: usize = (ByteSize::mib(4).as_u64() as usize) - GRPC_METADATA_SIZE_BYTES; + pub static ref DYNAMO_DB_ITEM_SIZE_LIMIT: usize = + ByteSize::kib(400).as_u64() as usize; + pub static ref GRPC_CHUNK_SIZE_LIMIT: usize = + (ByteSize::mib(4).as_u64() as usize) - GRPC_METADATA_SIZE_BYTES; } #[allow(dead_code)] diff --git a/services/commtest/tests/tunnelbroker_test.rs b/services/commtest/tests/tunnelbroker_integration_test.rs rename from services/commtest/tests/tunnelbroker_test.rs rename to services/commtest/tests/tunnelbroker_integration_test.rs --- a/services/commtest/tests/tunnelbroker_test.rs +++ b/services/commtest/tests/tunnelbroker_integration_test.rs @@ -2,6 +2,6 @@ mod tools; #[tokio::test] -async fn tunnelbroker_test() { +async fn tunnelbroker_integration_test() { assert!(false, "not implemented"); } diff --git a/services/scripts/run_integration_tests.sh b/services/scripts/run_integration_tests.sh --- a/services/scripts/run_integration_tests.sh +++ b/services/scripts/run_integration_tests.sh @@ -10,7 +10,7 @@ run_integration_test () { echo "integration tests tests will be run for the $1 service" # add -- --nocapture in the end to enable logs - cargo test "$1"_test --test '*' --manifest-path=commtest/Cargo.toml #-- --nocapture + cargo test "$1"_integration_test --test '*' --manifest-path=commtest/Cargo.toml #-- --nocapture } list_expected () {