diff --git a/Cargo.toml b/Cargo.toml index 83ae082..39a00d6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,4 +29,7 @@ eventsource-stream = "0.2" bytes = "1.6" # -- Others derive_more = { version = "1.0.0", features = ["from", "display"] } -value-ext = "0.0.3" # JC Authored. Early release (API might change). Be cautious when using in other projects. \ No newline at end of file +value-ext = "0.0.3" # JC Authored. Early release (API might change). Be cautious when using in other projects. + +[dev-dependencies] +serial_test = "3.2.0" \ No newline at end of file diff --git a/tests/tests_p_anthropic.rs b/tests/tests_p_anthropic.rs index ab83375..a83ee19 100644 --- a/tests/tests_p_anthropic.rs +++ b/tests/tests_p_anthropic.rs @@ -2,6 +2,7 @@ mod support; use crate::support::common_tests; use genai::resolver::AuthData; +use serial_test::serial; type Result = core::result::Result>; // For tests. @@ -13,16 +14,19 @@ const MODEL: &str = "claude-3-haiku-20240307"; // region: --- Chat #[tokio::test] +// #[serial(anthropic)] async fn test_chat_simple_ok() -> Result<()> { common_tests::common_test_chat_simple_ok(MODEL).await } #[tokio::test] +// #[serial(anthropic)] async fn test_chat_temperature_ok() -> Result<()> { common_tests::common_test_chat_temperature_ok(MODEL).await } #[tokio::test] +// #[serial(anthropic)] async fn test_chat_json_mode_ok() -> Result<()> { common_tests::common_test_chat_json_mode_ok(MODEL, true).await } @@ -32,16 +36,19 @@ async fn test_chat_json_mode_ok() -> Result<()> { // region: --- Chat Stream Tests #[tokio::test] +#[serial(anthropic)] async fn test_chat_stream_simple_ok() -> Result<()> { common_tests::common_test_chat_stream_simple_ok(MODEL).await } #[tokio::test] +#[serial(anthropic)] async fn test_chat_stream_capture_content_ok() -> Result<()> { common_tests::common_test_chat_stream_capture_content_ok(MODEL).await } #[tokio::test] +#[serial(anthropic)] async fn test_chat_stream_capture_all_ok() -> Result<()> { common_tests::common_test_chat_stream_capture_all_ok(MODEL).await } @@ -51,11 +58,13 @@ async fn test_chat_stream_capture_all_ok() -> Result<()> { // region: --- Tool Tests #[tokio::test] +#[serial(anthropic)] async fn test_tool_simple_ok() -> Result<()> { common_tests::common_test_tool_simple_ok(MODEL, false).await } #[tokio::test] +// #[serial(anthropic)] async fn test_tool_full_flow_ok() -> Result<()> { common_tests::common_test_tool_full_flow_ok(MODEL, false).await } @@ -65,6 +74,7 @@ async fn test_tool_full_flow_ok() -> Result<()> { // region: --- Resolver Tests #[tokio::test] +#[serial(anthropic)] async fn test_resolver_auth_ok() -> Result<()> { common_tests::common_test_resolver_auth_ok(MODEL, AuthData::from_env("ANTHROPIC_API_KEY")).await }