Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
a091fadf
Commit
a091fadf
authored
Aug 02, 2024
by
Michael Yang
Browse files
use testing tempdirs
parent
77ccbf04
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
server/routes_create_test.go
server/routes_create_test.go
+3
-0
No files found.
server/routes_create_test.go
View file @
a091fadf
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment