From 40e7b024b77443375ec93dfd50eb206af2ef4ebe Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Wed, 9 Sep 2026 15:35:59 -0700 Subject: [PATCH] refactor(core): flatten test modules --- litellm-rust/crates/core/Cargo.toml | 5 +++++ litellm-rust/crates/core/src/audio_transcription/mod.rs | 2 +- litellm-rust/crates/core/src/chat_completions/mod.rs | 2 +- litellm-rust/crates/core/src/messages/mod.rs | 2 +- litellm-rust/crates/core/src/ocr/mod.rs | 2 +- litellm-rust/crates/core/src/ocr/prepare.rs | 2 +- .../providers/anthropic/chat_completions/transformation.rs | 2 +- .../src/providers/azure_ai/ocr/document_intelligence/mod.rs | 2 +- litellm-rust/crates/core/src/providers/azure_ai/ocr/mod.rs | 2 +- .../src/providers/bedrock/chat_completions/transformation.rs | 2 +- litellm-rust/crates/core/src/providers/mistral/ocr/mod.rs | 2 +- litellm-rust/crates/core/src/providers/reducto/ocr/mod.rs | 2 +- .../crates/core/src/providers/vertex_ai/ocr/deepseek/mod.rs | 2 +- litellm-rust/crates/core/src/providers/vertex_ai/ocr/mod.rs | 2 +- .../tests.rs => anthropic_chat_completions.rs} | 0 .../{audio_transcription/tests.rs => audio_transcription.rs} | 0 .../{providers/azure_ai/ocr/tests.rs => azure_ai_ocr.rs} | 0 .../tests.rs => azure_document_intelligence_ocr.rs} | 0 .../tests.rs => bedrock_chat_completions.rs} | 0 .../tests/{chat_completions/tests.rs => chat_completions.rs} | 0 .../crates/core/tests/{messages/tests.rs => messages.rs} | 0 .../tests/{providers/mistral/ocr/tests.rs => mistral_ocr.rs} | 0 litellm-rust/crates/core/tests/{ocr/tests.rs => ocr.rs} | 0 .../crates/core/tests/{ocr/prepare.rs => ocr_prepare.rs} | 0 .../tests/{providers/reducto/ocr/tests.rs => reducto_ocr.rs} | 0 .../ocr/deepseek/tests.rs => vertex_ai_deepseek_ocr.rs} | 0 .../{providers/vertex_ai/ocr/tests.rs => vertex_ai_ocr.rs} | 0 27 files changed, 18 insertions(+), 13 deletions(-) rename litellm-rust/crates/core/tests/{providers/anthropic/chat_completions/tests.rs => anthropic_chat_completions.rs} (100%) rename litellm-rust/crates/core/tests/{audio_transcription/tests.rs => audio_transcription.rs} (100%) rename litellm-rust/crates/core/tests/{providers/azure_ai/ocr/tests.rs => azure_ai_ocr.rs} (100%) rename litellm-rust/crates/core/tests/{providers/azure_ai/ocr/document_intelligence/tests.rs => azure_document_intelligence_ocr.rs} (100%) rename litellm-rust/crates/core/tests/{providers/bedrock/chat_completions/tests.rs => bedrock_chat_completions.rs} (100%) rename litellm-rust/crates/core/tests/{chat_completions/tests.rs => chat_completions.rs} (100%) rename litellm-rust/crates/core/tests/{messages/tests.rs => messages.rs} (100%) rename litellm-rust/crates/core/tests/{providers/mistral/ocr/tests.rs => mistral_ocr.rs} (100%) rename litellm-rust/crates/core/tests/{ocr/tests.rs => ocr.rs} (100%) rename litellm-rust/crates/core/tests/{ocr/prepare.rs => ocr_prepare.rs} (100%) rename litellm-rust/crates/core/tests/{providers/reducto/ocr/tests.rs => reducto_ocr.rs} (100%) rename litellm-rust/crates/core/tests/{providers/vertex_ai/ocr/deepseek/tests.rs => vertex_ai_deepseek_ocr.rs} (100%) rename litellm-rust/crates/core/tests/{providers/vertex_ai/ocr/tests.rs => vertex_ai_ocr.rs} (100%) diff --git a/litellm-rust/crates/core/Cargo.toml b/litellm-rust/crates/core/Cargo.toml index 012c745fedc..21831d601c4 100644 --- a/litellm-rust/crates/core/Cargo.toml +++ b/litellm-rust/crates/core/Cargo.toml @@ -4,6 +4,11 @@ version = "0.1.0" edition.workspace = true license.workspace = true repository.workspace = true +autotests = false + +[[test]] +name = "workspace_crate_allowlist" +path = "tests/workspace_crate_allowlist.rs" [dependencies] base64.workspace = true diff --git a/litellm-rust/crates/core/src/audio_transcription/mod.rs b/litellm-rust/crates/core/src/audio_transcription/mod.rs index 2ee872ee768..8c0f1644f93 100644 --- a/litellm-rust/crates/core/src/audio_transcription/mod.rs +++ b/litellm-rust/crates/core/src/audio_transcription/mod.rs @@ -18,5 +18,5 @@ pub async fn audio_transcription(request: AudioTranscriptionRequest<'_>) -> Resu } #[cfg(all(test, feature = "bedrock-auth"))] -#[path = "../../tests/audio_transcription/tests.rs"] +#[path = "../../tests/audio_transcription.rs"] mod tests; diff --git a/litellm-rust/crates/core/src/chat_completions/mod.rs b/litellm-rust/crates/core/src/chat_completions/mod.rs index 27af0639697..cda5e2b0287 100644 --- a/litellm-rust/crates/core/src/chat_completions/mod.rs +++ b/litellm-rust/crates/core/src/chat_completions/mod.rs @@ -58,5 +58,5 @@ pub fn chat_completions_decline_reason( } #[cfg(test)] -#[path = "../../tests/chat_completions/tests.rs"] +#[path = "../../tests/chat_completions.rs"] mod tests; diff --git a/litellm-rust/crates/core/src/messages/mod.rs b/litellm-rust/crates/core/src/messages/mod.rs index 572d92aa1bc..b3562e6629f 100644 --- a/litellm-rust/crates/core/src/messages/mod.rs +++ b/litellm-rust/crates/core/src/messages/mod.rs @@ -28,5 +28,5 @@ pub async fn messages_stream(request: MessagesRequest<'_>) -> Result Result( } #[cfg(test)] -#[path = "../../tests/ocr/prepare.rs"] +#[path = "../../tests/ocr_prepare.rs"] mod tests; diff --git a/litellm-rust/crates/core/src/providers/anthropic/chat_completions/transformation.rs b/litellm-rust/crates/core/src/providers/anthropic/chat_completions/transformation.rs index 674f8d8e5a7..22a50c62c1e 100644 --- a/litellm-rust/crates/core/src/providers/anthropic/chat_completions/transformation.rs +++ b/litellm-rust/crates/core/src/providers/anthropic/chat_completions/transformation.rs @@ -214,5 +214,5 @@ impl ChatCompletionsProviderConfig for AnthropicChatCompletionsConfig { } #[cfg(test)] -#[path = "../../../../tests/providers/anthropic/chat_completions/tests.rs"] +#[path = "../../../../tests/anthropic_chat_completions.rs"] mod tests; diff --git a/litellm-rust/crates/core/src/providers/azure_ai/ocr/document_intelligence/mod.rs b/litellm-rust/crates/core/src/providers/azure_ai/ocr/document_intelligence/mod.rs index a948816cfe9..314093ee61f 100644 --- a/litellm-rust/crates/core/src/providers/azure_ai/ocr/document_intelligence/mod.rs +++ b/litellm-rust/crates/core/src/providers/azure_ai/ocr/document_intelligence/mod.rs @@ -1,6 +1,6 @@ pub(crate) mod polling; #[cfg(test)] -#[path = "../../../../../tests/providers/azure_ai/ocr/document_intelligence/tests.rs"] +#[path = "../../../../../tests/azure_document_intelligence_ocr.rs"] mod tests; pub mod transformation; pub mod types; diff --git a/litellm-rust/crates/core/src/providers/azure_ai/ocr/mod.rs b/litellm-rust/crates/core/src/providers/azure_ai/ocr/mod.rs index cfc42e15883..3b355e9e5c1 100644 --- a/litellm-rust/crates/core/src/providers/azure_ai/ocr/mod.rs +++ b/litellm-rust/crates/core/src/providers/azure_ai/ocr/mod.rs @@ -1,5 +1,5 @@ pub mod document_intelligence; #[cfg(test)] -#[path = "../../../../tests/providers/azure_ai/ocr/tests.rs"] +#[path = "../../../../tests/azure_ai_ocr.rs"] mod tests; pub mod transformation; diff --git a/litellm-rust/crates/core/src/providers/bedrock/chat_completions/transformation.rs b/litellm-rust/crates/core/src/providers/bedrock/chat_completions/transformation.rs index eab83002163..cb28b8a4515 100644 --- a/litellm-rust/crates/core/src/providers/bedrock/chat_completions/transformation.rs +++ b/litellm-rust/crates/core/src/providers/bedrock/chat_completions/transformation.rs @@ -299,5 +299,5 @@ impl ChatCompletionsProviderConfig for BedrockChatCompletionsConfig { } #[cfg(test)] -#[path = "../../../../tests/providers/bedrock/chat_completions/tests.rs"] +#[path = "../../../../tests/bedrock_chat_completions.rs"] mod tests; diff --git a/litellm-rust/crates/core/src/providers/mistral/ocr/mod.rs b/litellm-rust/crates/core/src/providers/mistral/ocr/mod.rs index 8eb3460a39c..dd32a78c502 100644 --- a/litellm-rust/crates/core/src/providers/mistral/ocr/mod.rs +++ b/litellm-rust/crates/core/src/providers/mistral/ocr/mod.rs @@ -1,5 +1,5 @@ #[cfg(test)] -#[path = "../../../../tests/providers/mistral/ocr/tests.rs"] +#[path = "../../../../tests/mistral_ocr.rs"] mod tests; pub mod transformation; pub mod types; diff --git a/litellm-rust/crates/core/src/providers/reducto/ocr/mod.rs b/litellm-rust/crates/core/src/providers/reducto/ocr/mod.rs index 934c26e2fb7..2f9fede2bd3 100644 --- a/litellm-rust/crates/core/src/providers/reducto/ocr/mod.rs +++ b/litellm-rust/crates/core/src/providers/reducto/ocr/mod.rs @@ -1,5 +1,5 @@ #[cfg(test)] -#[path = "../../../../tests/providers/reducto/ocr/tests.rs"] +#[path = "../../../../tests/reducto_ocr.rs"] mod tests; pub mod transformation; pub mod types; diff --git a/litellm-rust/crates/core/src/providers/vertex_ai/ocr/deepseek/mod.rs b/litellm-rust/crates/core/src/providers/vertex_ai/ocr/deepseek/mod.rs index b8d4b15d683..bb0f4098fbb 100644 --- a/litellm-rust/crates/core/src/providers/vertex_ai/ocr/deepseek/mod.rs +++ b/litellm-rust/crates/core/src/providers/vertex_ai/ocr/deepseek/mod.rs @@ -1,5 +1,5 @@ #[cfg(test)] -#[path = "../../../../../tests/providers/vertex_ai/ocr/deepseek/tests.rs"] +#[path = "../../../../../tests/vertex_ai_deepseek_ocr.rs"] mod tests; pub mod transformation; pub mod types; diff --git a/litellm-rust/crates/core/src/providers/vertex_ai/ocr/mod.rs b/litellm-rust/crates/core/src/providers/vertex_ai/ocr/mod.rs index d160071d0f3..44b07a06092 100644 --- a/litellm-rust/crates/core/src/providers/vertex_ai/ocr/mod.rs +++ b/litellm-rust/crates/core/src/providers/vertex_ai/ocr/mod.rs @@ -1,5 +1,5 @@ pub mod deepseek; #[cfg(test)] -#[path = "../../../../tests/providers/vertex_ai/ocr/tests.rs"] +#[path = "../../../../tests/vertex_ai_ocr.rs"] mod tests; pub mod transformation; diff --git a/litellm-rust/crates/core/tests/providers/anthropic/chat_completions/tests.rs b/litellm-rust/crates/core/tests/anthropic_chat_completions.rs similarity index 100% rename from litellm-rust/crates/core/tests/providers/anthropic/chat_completions/tests.rs rename to litellm-rust/crates/core/tests/anthropic_chat_completions.rs diff --git a/litellm-rust/crates/core/tests/audio_transcription/tests.rs b/litellm-rust/crates/core/tests/audio_transcription.rs similarity index 100% rename from litellm-rust/crates/core/tests/audio_transcription/tests.rs rename to litellm-rust/crates/core/tests/audio_transcription.rs diff --git a/litellm-rust/crates/core/tests/providers/azure_ai/ocr/tests.rs b/litellm-rust/crates/core/tests/azure_ai_ocr.rs similarity index 100% rename from litellm-rust/crates/core/tests/providers/azure_ai/ocr/tests.rs rename to litellm-rust/crates/core/tests/azure_ai_ocr.rs diff --git a/litellm-rust/crates/core/tests/providers/azure_ai/ocr/document_intelligence/tests.rs b/litellm-rust/crates/core/tests/azure_document_intelligence_ocr.rs similarity index 100% rename from litellm-rust/crates/core/tests/providers/azure_ai/ocr/document_intelligence/tests.rs rename to litellm-rust/crates/core/tests/azure_document_intelligence_ocr.rs diff --git a/litellm-rust/crates/core/tests/providers/bedrock/chat_completions/tests.rs b/litellm-rust/crates/core/tests/bedrock_chat_completions.rs similarity index 100% rename from litellm-rust/crates/core/tests/providers/bedrock/chat_completions/tests.rs rename to litellm-rust/crates/core/tests/bedrock_chat_completions.rs diff --git a/litellm-rust/crates/core/tests/chat_completions/tests.rs b/litellm-rust/crates/core/tests/chat_completions.rs similarity index 100% rename from litellm-rust/crates/core/tests/chat_completions/tests.rs rename to litellm-rust/crates/core/tests/chat_completions.rs diff --git a/litellm-rust/crates/core/tests/messages/tests.rs b/litellm-rust/crates/core/tests/messages.rs similarity index 100% rename from litellm-rust/crates/core/tests/messages/tests.rs rename to litellm-rust/crates/core/tests/messages.rs diff --git a/litellm-rust/crates/core/tests/providers/mistral/ocr/tests.rs b/litellm-rust/crates/core/tests/mistral_ocr.rs similarity index 100% rename from litellm-rust/crates/core/tests/providers/mistral/ocr/tests.rs rename to litellm-rust/crates/core/tests/mistral_ocr.rs diff --git a/litellm-rust/crates/core/tests/ocr/tests.rs b/litellm-rust/crates/core/tests/ocr.rs similarity index 100% rename from litellm-rust/crates/core/tests/ocr/tests.rs rename to litellm-rust/crates/core/tests/ocr.rs diff --git a/litellm-rust/crates/core/tests/ocr/prepare.rs b/litellm-rust/crates/core/tests/ocr_prepare.rs similarity index 100% rename from litellm-rust/crates/core/tests/ocr/prepare.rs rename to litellm-rust/crates/core/tests/ocr_prepare.rs diff --git a/litellm-rust/crates/core/tests/providers/reducto/ocr/tests.rs b/litellm-rust/crates/core/tests/reducto_ocr.rs similarity index 100% rename from litellm-rust/crates/core/tests/providers/reducto/ocr/tests.rs rename to litellm-rust/crates/core/tests/reducto_ocr.rs diff --git a/litellm-rust/crates/core/tests/providers/vertex_ai/ocr/deepseek/tests.rs b/litellm-rust/crates/core/tests/vertex_ai_deepseek_ocr.rs similarity index 100% rename from litellm-rust/crates/core/tests/providers/vertex_ai/ocr/deepseek/tests.rs rename to litellm-rust/crates/core/tests/vertex_ai_deepseek_ocr.rs diff --git a/litellm-rust/crates/core/tests/providers/vertex_ai/ocr/tests.rs b/litellm-rust/crates/core/tests/vertex_ai_ocr.rs similarity index 100% rename from litellm-rust/crates/core/tests/providers/vertex_ai/ocr/tests.rs rename to litellm-rust/crates/core/tests/vertex_ai_ocr.rs