mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
Fix leaky env variable causing flaky test (#3761)
This commit is contained in:
+19
-10
@@ -249,19 +249,28 @@ mod tests {
|
||||
#[test]
|
||||
#[serial]
|
||||
fn test_model_config_context_limits() {
|
||||
let config = ModelConfig::new("claude-3-opus")
|
||||
.unwrap()
|
||||
.with_context_limit(Some(150_000));
|
||||
assert_eq!(config.context_limit(), 150_000);
|
||||
// Clear all GOOSE environment variables to ensure clean test environment
|
||||
with_var("GOOSE_TEMPERATURE", None::<&str>, || {
|
||||
with_var("GOOSE_CONTEXT_LIMIT", None::<&str>, || {
|
||||
with_var("GOOSE_TOOLSHIM", None::<&str>, || {
|
||||
with_var("GOOSE_TOOLSHIM_OLLAMA_MODEL", None::<&str>, || {
|
||||
let config = ModelConfig::new("claude-3-opus")
|
||||
.unwrap()
|
||||
.with_context_limit(Some(150_000));
|
||||
assert_eq!(config.context_limit(), 150_000);
|
||||
|
||||
let config = ModelConfig::new("claude-3-opus").unwrap();
|
||||
assert_eq!(config.context_limit(), 200_000);
|
||||
let config = ModelConfig::new("claude-3-opus").unwrap();
|
||||
assert_eq!(config.context_limit(), 200_000);
|
||||
|
||||
let config = ModelConfig::new("gpt-4-turbo").unwrap();
|
||||
assert_eq!(config.context_limit(), 128_000);
|
||||
let config = ModelConfig::new("gpt-4-turbo").unwrap();
|
||||
assert_eq!(config.context_limit(), 128_000);
|
||||
|
||||
let config = ModelConfig::new("unknown-model").unwrap();
|
||||
assert_eq!(config.context_limit(), DEFAULT_CONTEXT_LIMIT);
|
||||
let config = ModelConfig::new("unknown-model").unwrap();
|
||||
assert_eq!(config.context_limit(), DEFAULT_CONTEXT_LIMIT);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user