Skip to content

Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

use testing tempdirs

Michael Yanga091fadfdaa2
diff --git a/server/routes_create_test.go b/server/routes_create_test.go
index 9fd7f8cd4..4de07b252 100644
--- a/server/routes_create_test.go
+++ b/server/routes_create_test.go
@@ -2,6 +2,7 @@ package server
import (
"bytes"
+ "cmp"
"encoding/json"
"fmt"
"io"
@@ -53,6 +54,8 @@ func (t *responseRecorder) CloseNotify() <-chan bool {
func createRequest(t *testing.T, fn func(*gin.Context), body any) *httptest.ResponseRecorder {
t.Helper()
+ // if OLLAMA_MODELS is not set, set it to the temp directory
+ t.Setenv("OLLAMA_MODELS", cmp.Or(os.Getenv("OLLAMA_MODELS"), t.TempDir()))
w := NewRecorder()
c, _ := gin.CreateTestContext(w)