This commit is contained in:
@@ -20,7 +20,7 @@ func TestCPUDiscoveryIsReadOnlyAndCredentialFree(t *testing.T) {
|
||||
if r.Method != http.MethodGet || r.URL.Path != "/v1/models" || r.Header.Get("Authorization") != "" {
|
||||
t.Fatalf("unexpected request %s %s auth=%q", r.Method, r.URL.Path, r.Header.Get("Authorization"))
|
||||
}
|
||||
_, _ = io.WriteString(w, `{"data":[{"id":"same-name","created":1,"owned_by":"local","meta":{"n_ctx":2048,"n_params":3,"size":10,"ftype":"Q4"}}]}`)
|
||||
_, _ = io.WriteString(w, `{"data":[{"id":"same-name","created":`+string(rune('0'+requests))+`,"owned_by":"local","meta":{"n_ctx":2048,"n_params":3,"size":10,"ftype":"Q4"}}]}`)
|
||||
}))
|
||||
defer server.Close()
|
||||
adapter, err := models.NewOpenAICompatibleLocalAdapter(server.URL+"/v1", nil)
|
||||
@@ -31,6 +31,10 @@ func TestCPUDiscoveryIsReadOnlyAndCredentialFree(t *testing.T) {
|
||||
if probe.Health != capability.HealthAvailable || len(discovered) != 1 || requests != 1 {
|
||||
t.Fatalf("probe=%+v models=%+v requests=%d", probe, discovered, requests)
|
||||
}
|
||||
second, probe := adapter.Discover(context.Background())
|
||||
if probe.Health != capability.HealthAvailable || len(second) != 1 || second[0].Fingerprint != discovered[0].Fingerprint {
|
||||
t.Fatalf("volatile created field changed fingerprint: %s != %s", second[0].Fingerprint, discovered[0].Fingerprint)
|
||||
}
|
||||
}
|
||||
|
||||
func TestOllamaDiscoveryDoesNotRunInference(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user