Revamp go based integration tests

This uplevels the integration tests to run the server which can allow
testing an existing server, or a remote server.
This commit is contained in:
Daniel Hiltgen 2024-03-23 14:24:18 +01:00
parent a5ba0fcf78
commit 949b6c01e0
8 changed files with 313 additions and 261 deletions

28
integration/basic_test.go Normal file
View file

@ -0,0 +1,28 @@
//go:build integration
package integration
import (
"context"
"net/http"
"testing"
"time"
"github.com/jmorganca/ollama/api"
)
func TestOrcaMiniBlueSky(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute)
defer cancel()
// Set up the test data
req := api.GenerateRequest{
Model: "orca-mini",
Prompt: "why is the sky blue?",
Stream: &stream,
Options: map[string]interface{}{
"temperature": 0,
"seed": 123,
},
}
GenerateTestHelper(ctx, t, &http.Client{}, req, []string{"rayleigh"})
}