Decouple application tests from bundled profiles
This commit is contained in:
@@ -191,19 +191,24 @@ func TestPublicConstructionRejectsSuppliedInvalidMainInput(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestPublicConstructionCanOverlayMaintainedBackend(t *testing.T) {
|
||||
endpoint := "http://local-openrouter.example/v1"
|
||||
func TestPublicConstructionUsesProgrammaticBackendAndProfileSources(t *testing.T) {
|
||||
endpoint, backendID, model := "http://application.example/v1", "application-backend", "synthetic-model"
|
||||
engine, err := promptkit.NewEngine(promptkit.Config{Sources: promptkit.ConfigurationSources{
|
||||
Underlays: []configkit.Underlay{{Inputs: []configkit.Input{{Source: promptkit.BackendSource("operator backend", map[string]promptkit.BackendConfig{
|
||||
promptkit.BackendOpenRouter: {Endpoint: &endpoint},
|
||||
})}}}},
|
||||
Underlays: []configkit.Underlay{{Inputs: []configkit.Input{
|
||||
{Source: promptkit.BackendSource("operator backend", map[string]promptkit.BackendConfig{
|
||||
backendID: {Endpoint: &endpoint},
|
||||
})},
|
||||
{Source: promptkit.ProfileSource("operator profile", map[string]promptkit.ProfileConfig{
|
||||
"application-profile": {Backend: &backendID, Model: &model},
|
||||
})},
|
||||
}}},
|
||||
}})
|
||||
if err != nil {
|
||||
t.Fatalf("construct engine with backend overlay: %v", err)
|
||||
}
|
||||
inspection, err := engine.InspectProfile(context.Background(), "mistral-small-3")
|
||||
inspection, err := engine.InspectProfile(context.Background(), "application-profile")
|
||||
if err != nil {
|
||||
t.Fatalf("inspect catalog profile: %v", err)
|
||||
t.Fatalf("inspect configured profile: %v", err)
|
||||
}
|
||||
if inspection.EffectiveModelParams.Endpoint != endpoint {
|
||||
t.Fatalf("effective endpoint = %q, want %q", inspection.EffectiveModelParams.Endpoint, endpoint)
|
||||
|
||||
Reference in New Issue
Block a user