Merge pull request #6546 from ollama/mxyng/fix-test

fix(test): do not clobber models directory
This commit is contained in:
Michael Yang 2024-08-28 15:37:47 -07:00 committed by GitHub
commit 47c2b947a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -139,6 +139,7 @@ The temperature in San Francisco, CA is 70°F and in Toronto, Canada is 20°C.`,
func TestParseFromFileFromLayer(t *testing.T) {
tempModels := t.TempDir()
t.Setenv("OLLAMA_MODELS", tempModels)
file, err := os.CreateTemp(tempModels, "")
if err != nil {
@ -189,6 +190,7 @@ func TestParseFromFileFromLayer(t *testing.T) {
func TestParseLayerFromCopy(t *testing.T) {
tempModels := t.TempDir()
t.Setenv("OLLAMA_MODELS", tempModels)
file2, err := os.CreateTemp(tempModels, "")
if err != nil {