Verify native vLLM authentication findings
This commit is contained in:
@@ -265,7 +265,9 @@ part of this work.
|
|||||||
## Stage 5: Adopt PromptKit v0.25.0 and preserve existing report evidence
|
## Stage 5: Adopt PromptKit v0.25.0 and preserve existing report evidence
|
||||||
|
|
||||||
**Complete.** Selected the published module and checked its license notice;
|
**Complete.** Selected the published module and checked its license notice;
|
||||||
ckprompt forwards provider and explicit false zero-cost inspection data. Smoke
|
ckprompt forwards provider and explicit false zero-cost inspection data. An
|
||||||
|
offline native vLLM authentication fixture confirms supported, applicable, and
|
||||||
|
accepted-credential findings reach the command report. Smoke
|
||||||
projection/render tests cover reasoning, absent and zero ratios, percentages,
|
projection/render tests cover reasoning, absent and zero ratios, percentages,
|
||||||
and retained single/aggregate evidence in text, YAML, and JSON. The affected
|
and retained single/aggregate evidence in text, YAML, and JSON. The affected
|
||||||
Go 1.27.4 workspace suite passes.
|
Go 1.27.4 workspace suite passes.
|
||||||
|
|||||||
40
integrations/ckprompt/vllm_evidence_test.go
Normal file
40
integrations/ckprompt/vllm_evidence_test.go
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
package ckprompt
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"context"
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"go.maximumdirect.net/ckconfig"
|
||||||
|
commandkit "go.maximumdirect.net/commandkit"
|
||||||
|
"go.maximumdirect.net/configkit"
|
||||||
|
promptkit "go.maximumdirect.net/promptkit"
|
||||||
|
)
|
||||||
|
|
||||||
|
type smokeTransport func(*http.Request) (*http.Response, error)
|
||||||
|
|
||||||
|
func (f smokeTransport) RoundTrip(r *http.Request) (*http.Response, error) { return f(r) }
|
||||||
|
|
||||||
|
func TestVLLMAuthenticationEvidenceFlowsThroughCommand(t *testing.T) {
|
||||||
|
source := configkit.Input{Destination: configkit.Keys("promptkit"), Source: configkit.Mapping("fixture", map[string]any{"backends": []any{map[string]any{"id": "local", "provider": "vllm", "endpoint": "https://example.invalid/v1", "zero_cost": false}}})}
|
||||||
|
client := &http.Client{Transport: smokeTransport(func(r *http.Request) (*http.Response, error) {
|
||||||
|
return &http.Response{StatusCode: 200, Header: make(http.Header), Body: io.NopCloser(strings.NewReader(`{"object":"list","data":[]}`)), Request: r}, nil
|
||||||
|
})}
|
||||||
|
engine, err := promptkit.NewEngine(promptkit.Config{Sources: promptkit.ConfigurationSources{Main: &source}, HTTPClient: client}, promptkit.WithBundledOpenRouter(false))
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
loader := func(context.Context, ckconfig.Selection, struct{}, struct{}) (*promptkit.Engine, error) {
|
||||||
|
return engine, nil
|
||||||
|
}
|
||||||
|
suite := WithSmokeTesting(FromEngine(loader), loader, nil)
|
||||||
|
app := newPromptTestApp(t, Command(suite))
|
||||||
|
var out bytes.Buffer
|
||||||
|
result := app.Execute(context.Background(), []string{"promptkit", "test", "authentication", "--llm-backend=local", "--format=json"}, commandkit.Streams{Out: &out})
|
||||||
|
if result.Status != 0 || !strings.Contains(out.String(), `"supported": true`) || !strings.Contains(out.String(), `"applicable": true`) || !strings.Contains(out.String(), `"credentials_accepted": true`) {
|
||||||
|
t.Fatalf("outcome=%#v report=%s", result, out.String())
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user