mirror of
https://github.com/aljazceru/goose.git
synced 2025-12-18 14:44:21 +01:00
Merge pull request #8 from aljazceru/codex/add-serial_test-crate-and-scope-env-vars
Serialize tests that modify environment variables
This commit is contained in:
@@ -187,6 +187,7 @@ mod tests {
|
|||||||
use super::*;
|
use super::*;
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
use serial_test::serial;
|
||||||
use tokio::sync::Mutex;
|
use tokio::sync::Mutex;
|
||||||
use tracing::dispatcher;
|
use tracing::dispatcher;
|
||||||
use wiremock::matchers::{method, path};
|
use wiremock::matchers::{method, path};
|
||||||
@@ -389,6 +390,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
#[serial]
|
||||||
async fn test_create_langfuse_observer() {
|
async fn test_create_langfuse_observer() {
|
||||||
let fixture = TestFixture::new().await.with_mock_server().await;
|
let fixture = TestFixture::new().await.with_mock_server().await;
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ use goose::providers::{
|
|||||||
};
|
};
|
||||||
use mcp_core::content::Content;
|
use mcp_core::content::Content;
|
||||||
use mcp_core::tool::Tool;
|
use mcp_core::tool::Tool;
|
||||||
|
use serial_test::serial;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
@@ -352,6 +353,7 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
#[serial]
|
||||||
async fn test_openai_provider() -> Result<()> {
|
async fn test_openai_provider() -> Result<()> {
|
||||||
test_provider(
|
test_provider(
|
||||||
"OpenAI",
|
"OpenAI",
|
||||||
@@ -363,6 +365,7 @@ async fn test_openai_provider() -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
#[serial]
|
||||||
async fn test_azure_provider() -> Result<()> {
|
async fn test_azure_provider() -> Result<()> {
|
||||||
test_provider(
|
test_provider(
|
||||||
"Azure",
|
"Azure",
|
||||||
@@ -378,6 +381,7 @@ async fn test_azure_provider() -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
#[serial]
|
||||||
async fn test_bedrock_provider_long_term_credentials() -> Result<()> {
|
async fn test_bedrock_provider_long_term_credentials() -> Result<()> {
|
||||||
test_provider(
|
test_provider(
|
||||||
"Bedrock",
|
"Bedrock",
|
||||||
@@ -389,6 +393,7 @@ async fn test_bedrock_provider_long_term_credentials() -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
#[serial]
|
||||||
async fn test_bedrock_provider_aws_profile_credentials() -> Result<()> {
|
async fn test_bedrock_provider_aws_profile_credentials() -> Result<()> {
|
||||||
let env_mods = HashMap::from_iter([
|
let env_mods = HashMap::from_iter([
|
||||||
// Ensure to unset long-term credentials to use AWS Profile provider
|
// Ensure to unset long-term credentials to use AWS Profile provider
|
||||||
@@ -406,6 +411,7 @@ async fn test_bedrock_provider_aws_profile_credentials() -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
#[serial]
|
||||||
async fn test_databricks_provider() -> Result<()> {
|
async fn test_databricks_provider() -> Result<()> {
|
||||||
test_provider(
|
test_provider(
|
||||||
"Databricks",
|
"Databricks",
|
||||||
@@ -417,6 +423,7 @@ async fn test_databricks_provider() -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
#[serial]
|
||||||
async fn test_databricks_provider_oauth() -> Result<()> {
|
async fn test_databricks_provider_oauth() -> Result<()> {
|
||||||
let mut env_mods = HashMap::new();
|
let mut env_mods = HashMap::new();
|
||||||
env_mods.insert("DATABRICKS_TOKEN", None);
|
env_mods.insert("DATABRICKS_TOKEN", None);
|
||||||
@@ -431,6 +438,7 @@ async fn test_databricks_provider_oauth() -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
#[serial]
|
||||||
async fn test_ollama_provider() -> Result<()> {
|
async fn test_ollama_provider() -> Result<()> {
|
||||||
test_provider(
|
test_provider(
|
||||||
"Ollama",
|
"Ollama",
|
||||||
@@ -442,11 +450,13 @@ async fn test_ollama_provider() -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
#[serial]
|
||||||
async fn test_groq_provider() -> Result<()> {
|
async fn test_groq_provider() -> Result<()> {
|
||||||
test_provider("Groq", &["GROQ_API_KEY"], None, groq::GroqProvider::default).await
|
test_provider("Groq", &["GROQ_API_KEY"], None, groq::GroqProvider::default).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
#[serial]
|
||||||
async fn test_anthropic_provider() -> Result<()> {
|
async fn test_anthropic_provider() -> Result<()> {
|
||||||
test_provider(
|
test_provider(
|
||||||
"Anthropic",
|
"Anthropic",
|
||||||
@@ -458,6 +468,7 @@ async fn test_anthropic_provider() -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
#[serial]
|
||||||
async fn test_openrouter_provider() -> Result<()> {
|
async fn test_openrouter_provider() -> Result<()> {
|
||||||
test_provider(
|
test_provider(
|
||||||
"OpenRouter",
|
"OpenRouter",
|
||||||
@@ -469,6 +480,7 @@ async fn test_openrouter_provider() -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
#[serial]
|
||||||
async fn test_google_provider() -> Result<()> {
|
async fn test_google_provider() -> Result<()> {
|
||||||
test_provider(
|
test_provider(
|
||||||
"Google",
|
"Google",
|
||||||
|
|||||||
Reference in New Issue
Block a user