Decouple application tests from bundled profiles
This commit is contained in:
@@ -20,18 +20,19 @@ func aliasPrompt() map[string]any {
|
||||
})}}
|
||||
}
|
||||
|
||||
func TestProfileInheritanceBuiltInAliasWorkflow(t *testing.T) {
|
||||
standardID, reasoning, timeout := "promptkit-openrouter-standard", "high", 120
|
||||
func TestProfileInheritanceConfiguredBaseAliasWorkflow(t *testing.T) {
|
||||
baseID, baseEndpoint, baseModel, reasoning, timeout := "base", "https://profile.example/v1", "synthetic-model", "high", 120
|
||||
engine, err := promptkit.NewEngine(promptkit.Config{Sources: promptkit.ConfigurationSources{
|
||||
Underlays: []configkit.Underlay{{Inputs: []configkit.Input{{Source: promptkit.ProfileSource("application alias", map[string]promptkit.ProfileConfig{
|
||||
"child": {Extends: &standardID, ReasoningEffort: &reasoning, TimeoutSeconds: &timeout},
|
||||
"base": {Endpoint: &baseEndpoint, Model: &baseModel},
|
||||
"child": {Extends: &baseID, ReasoningEffort: &reasoning, TimeoutSeconds: &timeout},
|
||||
})}}}},
|
||||
Main: &configkit.Input{Source: configkit.Mapping("prompt", aliasPrompt())},
|
||||
}})
|
||||
if err != nil {
|
||||
t.Fatalf("construct alias engine: %v", err)
|
||||
}
|
||||
base, err := engine.InspectProfile(context.Background(), standardID)
|
||||
base, err := engine.InspectProfile(context.Background(), baseID)
|
||||
if err != nil {
|
||||
t.Fatalf("inspect base: %v", err)
|
||||
}
|
||||
@@ -57,9 +58,9 @@ func TestProfileInheritanceBuiltInAliasWorkflow(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestProfileInheritanceYAMLAliasOfBuiltIn(t *testing.T) {
|
||||
func TestProfileInheritanceYAMLAliasOfConfiguredProfile(t *testing.T) {
|
||||
inputs, err := promptkit.FilesystemInputs("profile alias", fstest.MapFS{
|
||||
"config/alias.yaml": &fstest.MapFile{Data: []byte("profiles:\n yaml-alias:\n extends: promptkit-openrouter-standard\n")},
|
||||
"config/alias.yaml": &fstest.MapFile{Data: []byte("profiles:\n base:\n model: synthetic-model\n yaml-alias:\n extends: base\n")},
|
||||
}, "config")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
||||
Reference in New Issue
Block a user