From bbb1657e42d18be11c0e6982bbbbf4df52c8ce19 Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Tue, 11 Mar 2025 09:42:13 -0300 Subject: [PATCH] refactor(tests): Simplify ChaosTest initialization and remove obsolete integration test --- gb-testing/src/chaos/mod.rs | 2 +- gb-testing/src/load/mod.rs | 1 - gb-testing/tests/chaos_kubernetes_test.rs | 2 +- .../{int_file_list_test.rs => integration_file_list_test.rs} | 0 .../{file_upload_test.rs => integration_file_upload_test.rs} | 4 ++-- 5 files changed, 4 insertions(+), 5 deletions(-) rename gb-testing/tests/{int_file_list_test.rs => integration_file_list_test.rs} (100%) rename gb-testing/tests/{file_upload_test.rs => integration_file_upload_test.rs} (96%) diff --git a/gb-testing/src/chaos/mod.rs b/gb-testing/src/chaos/mod.rs index 2becfeb..a234d76 100644 --- a/gb-testing/src/chaos/mod.rs +++ b/gb-testing/src/chaos/mod.rs @@ -3,7 +3,7 @@ pub struct ChaosTest { } impl ChaosTest { - pub async fn new(namespace: String) -> anyhow::Result { + pub async fn new() -> anyhow::Result { // Initialize the ChaosTest struct Ok(ChaosTest { }) } diff --git a/gb-testing/src/load/mod.rs b/gb-testing/src/load/mod.rs index e741bff..720fa1a 100644 --- a/gb-testing/src/load/mod.rs +++ b/gb-testing/src/load/mod.rs @@ -1,4 +1,3 @@ -use goose::prelude::*; use serde::{Deserialize, Serialize}; #[derive(Debug, Serialize, Deserialize)] diff --git a/gb-testing/tests/chaos_kubernetes_test.rs b/gb-testing/tests/chaos_kubernetes_test.rs index 6f6591e..48f7136 100644 --- a/gb-testing/tests/chaos_kubernetes_test.rs +++ b/gb-testing/tests/chaos_kubernetes_test.rs @@ -2,7 +2,7 @@ use gb_testing::chaos::ChaosTest; #[tokio::test] async fn test_kubernetes_chaos() -> anyhow::Result<()> { - let chaos_test = ChaosTest::new("general-bots".to_string()).await?; + let chaos_test = ChaosTest::new().await?; chaos_test.network_partition().await?; diff --git a/gb-testing/tests/int_file_list_test.rs b/gb-testing/tests/integration_file_list_test.rs similarity index 100% rename from gb-testing/tests/int_file_list_test.rs rename to gb-testing/tests/integration_file_list_test.rs diff --git a/gb-testing/tests/file_upload_test.rs b/gb-testing/tests/integration_file_upload_test.rs similarity index 96% rename from gb-testing/tests/file_upload_test.rs rename to gb-testing/tests/integration_file_upload_test.rs index 1cfe4a7..75ff4da 100644 --- a/gb-testing/tests/file_upload_test.rs +++ b/gb-testing/tests/integration_file_upload_test.rs @@ -3,7 +3,7 @@ use anyhow::Result; use bytes::Bytes; use gb_core::models::AppState; use gb_file::handlers::upload_file; -use minio::s3::args::{BucketExistsArgs, GetObjectArgs, MakeBucketArgs, StatObjectArgs}; +use minio::s3::args::{BucketExistsArgs, MakeBucketArgs, StatObjectArgs}; use minio::s3::client::ClientBuilder as MinioClientBuilder; use minio::s3::creds::StaticProvider; use minio::s3::http::BaseUrl; @@ -55,7 +55,7 @@ async fn test_successful_file_upload() -> Result<()> { // Prepare a multipart request let boundary = "----WebKitFormBoundaryX"; - let content_type = format!("multipart/form-data; boundary={}", boundary); + // Read the file content let mut file_content = Vec::new();