Fix leaky env variable causing flaky test (#3761)
This commit is contained in:
+19
-10
@@ -249,19 +249,28 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
#[serial]
|
#[serial]
|
||||||
fn test_model_config_context_limits() {
|
fn test_model_config_context_limits() {
|
||||||
let config = ModelConfig::new("claude-3-opus")
|
// Clear all GOOSE environment variables to ensure clean test environment
|
||||||
.unwrap()
|
with_var("GOOSE_TEMPERATURE", None::<&str>, || {
|
||||||
.with_context_limit(Some(150_000));
|
with_var("GOOSE_CONTEXT_LIMIT", None::<&str>, || {
|
||||||
assert_eq!(config.context_limit(), 150_000);
|
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();
|
let config = ModelConfig::new("claude-3-opus").unwrap();
|
||||||
assert_eq!(config.context_limit(), 200_000);
|
assert_eq!(config.context_limit(), 200_000);
|
||||||
|
|
||||||
let config = ModelConfig::new("gpt-4-turbo").unwrap();
|
let config = ModelConfig::new("gpt-4-turbo").unwrap();
|
||||||
assert_eq!(config.context_limit(), 128_000);
|
assert_eq!(config.context_limit(), 128_000);
|
||||||
|
|
||||||
let config = ModelConfig::new("unknown-model").unwrap();
|
let config = ModelConfig::new("unknown-model").unwrap();
|
||||||
assert_eq!(config.context_limit(), DEFAULT_CONTEXT_LIMIT);
|
assert_eq!(config.context_limit(), DEFAULT_CONTEXT_LIMIT);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user