diff --git a/services/commtest/tests/backup_test.rs b/services/commtest/tests/backup_test.rs --- a/services/commtest/tests/backup_test.rs +++ b/services/commtest/tests/backup_test.rs @@ -15,12 +15,16 @@ use bytesize::ByteSize; use tools::Error; +use std::env; + use backup_utils::BackupServiceClient; #[tokio::test] async fn backup_test() -> Result<(), Error> { + let port = env::var("COMM_SERVICES_PORT_BACKUP") + .expect("port env var expected but not received"); let mut client = - BackupServiceClient::connect("http://localhost:50052").await?; + BackupServiceClient::connect(format!("http://localhost:{}", port)).await?; let attachments_fill_size: u64 = 500; diff --git a/services/commtest/tests/blob_test.rs b/services/commtest/tests/blob_test.rs --- a/services/commtest/tests/blob_test.rs +++ b/services/commtest/tests/blob_test.rs @@ -10,13 +10,15 @@ mod tools; use bytesize::ByteSize; +use std::env; use blob_utils::{BlobData, BlobServiceClient}; use tools::Error; #[tokio::test] async fn blob_test() -> Result<(), Error> { - let mut client = BlobServiceClient::connect("http://localhost:50053").await?; + let port = env::var("COMM_SERVICES_PORT_BLOB").expect("port env var expected but not received"); + let mut client = BlobServiceClient::connect(format!("http://localhost:{}", port)).await?; let blob_data = vec![ BlobData { 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 @@ -40,4 +40,8 @@ exit 1; fi; +set -o allexport +source .env +set +o allexport + run_integration_test "$SERVICE"