Migrate facade tests to the new configuration contracts
This commit is contained in:
@@ -21,7 +21,7 @@ func TestConfigurationInspectionDiffsCapturedValues(t *testing.T) {
|
||||
t.Fatalf("difference count = %d, want 1: %+v", len(differences), differences)
|
||||
}
|
||||
difference := differences[0]
|
||||
if got, want := difference.Path.String(), "/profiles"; got != want {
|
||||
if got, want := difference.Path.String(), "/promptkit/profiles"; got != want {
|
||||
t.Fatalf("difference path = %q, want %q", got, want)
|
||||
}
|
||||
if !strings.Contains(difference.Left.YAML, "earlier-model") || !strings.Contains(difference.Right.YAML, "later-model") {
|
||||
@@ -84,7 +84,7 @@ func TestConfigurationInspectionDiffIgnoresSourceHistory(t *testing.T) {
|
||||
func TestConfigurationInspectionDiffUsesNormalizedValues(t *testing.T) {
|
||||
inspect := func(endpoint string) promptkit.ConfigurationInspection {
|
||||
t.Helper()
|
||||
engine, err := promptkit.NewEngine(promptkit.Config{Sources: promptkit.ConfigurationSources{Underlays: []configkit.Underlay{{Inputs: []configkit.Input{{Source: configkit.Mapping("backend", map[string]any{
|
||||
engine, err := promptkit.NewEngine(promptkit.Config{Sources: promptkit.ConfigurationSources{Underlays: []configkit.Underlay{{Inputs: []configkit.Input{{Destination: configkit.Keys("promptkit"), Source: configkit.Mapping("backend", map[string]any{
|
||||
"backends": []any{map[string]any{"id": "local", "endpoint": endpoint}},
|
||||
})}}}}}})
|
||||
if err != nil {
|
||||
@@ -104,7 +104,7 @@ func TestConfigurationInspectionDiffUsesNormalizedValues(t *testing.T) {
|
||||
}
|
||||
changed := inspect("https://other.invalid/v1")
|
||||
differences, err = left.Diff(changed)
|
||||
if err != nil || len(differences) != 1 || differences[0].Path.String() != "/backends" {
|
||||
if err != nil || len(differences) != 1 || differences[0].Path.String() != "/promptkit/backends" {
|
||||
t.Fatalf("changed diff = %+v, %v", differences, err)
|
||||
}
|
||||
}
|
||||
@@ -122,7 +122,7 @@ func TestConfigurationInspectionDiffReportsPresenceAndSequences(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("compare presence and sequence values: %v", err)
|
||||
}
|
||||
if len(differences) != 1 || differences[0].Path.String() != "/backends" {
|
||||
if len(differences) != 1 || differences[0].Path.String() != "/promptkit/backends" {
|
||||
t.Fatalf("atomic backend list difference = %+v", differences)
|
||||
}
|
||||
difference := differences[0]
|
||||
@@ -147,7 +147,7 @@ func TestConfigurationInspectionDiffProtectsSensitiveValuesAndReturnedRecords(t
|
||||
if err != nil {
|
||||
t.Fatalf("compare sensitive values: %v", err)
|
||||
}
|
||||
if len(differences) != 1 || differences[0].Path.String() != "/backends" {
|
||||
if len(differences) != 1 || differences[0].Path.String() != "/promptkit/backends" {
|
||||
t.Fatalf("sensitive backend list difference = %+v", differences)
|
||||
}
|
||||
secret := differences[0]
|
||||
@@ -176,7 +176,7 @@ func TestConfigurationInspectionDiffProtectsSensitiveValuesAndReturnedRecords(t
|
||||
if _, exists := againByPath["/caller/mutation"]; exists {
|
||||
t.Fatal("mutating returned path reached retained inspection")
|
||||
}
|
||||
if _, exists := againByPath["/backends"]; !exists {
|
||||
if _, exists := againByPath["/promptkit/backends"]; !exists {
|
||||
t.Fatalf("original backend path was lost after mutation: %+v", again)
|
||||
}
|
||||
for _, difference := range again {
|
||||
@@ -201,7 +201,7 @@ func TestConfigurationInspectionDiffMasksSensitiveShapeReplacement(t *testing.T)
|
||||
if err != nil {
|
||||
t.Fatalf("compare sensitive shape replacement: %v", err)
|
||||
}
|
||||
if len(differences) != 1 || differences[0].Path.String() != "/backends" {
|
||||
if len(differences) != 1 || differences[0].Path.String() != "/promptkit/backends" {
|
||||
t.Fatalf("shape replacement differences = %+v", differences)
|
||||
}
|
||||
difference := differences[0]
|
||||
@@ -225,7 +225,7 @@ func comparisonInspectionFrom(t *testing.T, source, model string, extraParams ma
|
||||
backend["extra_params"] = extraParams
|
||||
}
|
||||
engine, err := promptkit.NewEngine(promptkit.Config{Sources: promptkit.ConfigurationSources{
|
||||
Underlays: []configkit.Underlay{{Inputs: []configkit.Input{{Source: configkit.Mapping(source, map[string]any{
|
||||
Underlays: []configkit.Underlay{{Inputs: []configkit.Input{{Destination: configkit.Keys("promptkit"), Source: configkit.Mapping(source, map[string]any{
|
||||
"backends": []any{backend},
|
||||
"profiles": []any{map[string]any{
|
||||
"id": "offline", "backend": "local",
|
||||
|
||||
Reference in New Issue
Block a user