=== required: endpoint === Contract: when values.endpoint is empty (or absent), both charts fail the render with a long required-guard message that explains (a) the field is cluster-wide, (b) why it cannot be auto-derived, (c) which topologies (VIP, external LB, single-node) need what. The message i
(t *testing.T)
| 88 | // The message is identical between cozystack and generic — pin a |
| 89 | // substring stable enough to survive minor wording tweaks. |
| 90 | func TestContract_Errors_EndpointRequired(t *testing.T) { |
| 91 | for _, chartPath := range []string{cozystackChartPath, genericChartPath} { |
| 92 | t.Run(chartPath, func(t *testing.T) { |
| 93 | err := renderExpectingError(t, chartPath, "", helmEngineEmptyLookup, map[string]any{ |
| 94 | "endpoint": "", |
| 95 | "advertisedSubnets": []any{testAdvertisedSubnet}, |
| 96 | }) |
| 97 | if err == nil { |
| 98 | t.Fatalf("expected required-endpoint error, got nil") |
| 99 | } |
| 100 | msg := err.Error() |
| 101 | if !strings.Contains(msg, "endpoint") { |
| 102 | t.Errorf("error must mention 'endpoint', got: %s", msg) |
| 103 | } |
| 104 | if !strings.Contains(msg, "https://") { |
| 105 | t.Errorf("error must show URL example, got: %s", msg) |
| 106 | } |
| 107 | if !strings.Contains(msg, "talm template") { |
| 108 | t.Errorf("error must mention 'talm template' (explains why no auto-derivation), got: %s", msg) |
| 109 | } |
| 110 | }) |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | // === fail: advertisedSubnets empty + empty discovery === |
| 115 |
nothing calls this directly
no test coverage detected