"git@developer.sourcefind.cn:zhaoyu6/sglang.git" did not exist on "2fa5cec7754432590f0b1478bf7b2ee8333ae4d3"
Commit a091fadf authored by Michael Yang's avatar Michael Yang
Browse files

use testing tempdirs

parent 77ccbf04
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment