Complete resource inspection validation and coverage
This commit is contained in:
@@ -51,3 +51,17 @@ func TestResolvedBackendAndProfileResources(t *testing.T) {
|
||||
t.Fatalf("cancellation = %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBackendResourcePreservesInheritedDiagnostics(t *testing.T) {
|
||||
state, err := load(mapping("backend diagnostics", map[string]any{"backends": []any{
|
||||
map[string]any{"id": "parent", "endpoint": "https://provider.test/v1", "smoke_tests": map[string]any{"reachability": map[string]any{"endpoint": "https://probe.test/ready"}, "authentication": map[string]any{"kind": "none"}}},
|
||||
map[string]any{"id": "child", "extends": map[string]any{"id": "parent"}},
|
||||
}}), nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
got, err := state.InspectBackend(context.Background(), "child")
|
||||
if err != nil || got.ID != "child" || got.ConcurrencyLimit != nil || got.QueueCapacity != nil || got.SmokeTests == nil || got.SmokeTests.Reachability == nil || got.SmokeTests.Reachability.Endpoint == nil || *got.SmokeTests.Reachability.Endpoint != "https://probe.test/ready" || got.SmokeTests.Authentication == nil || got.SmokeTests.Authentication.Kind == nil || *got.SmokeTests.Authentication.Kind != "none" || got.SmokeTests.Authentication.Endpoint != nil {
|
||||
t.Fatalf("inherited diagnostics = %+v, %v", got, err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user