Closed chrisseto closed 3 months ago
Oh gofmt
complains:
task: [ci:lint] gofumpt -w .
task: [ci:lint] git diff --exit-code
diff --git a/charts/redpanda/chart_template_test.go b/charts/redpanda/chart_template_test.go
index 89a05d8..e6d5e41 100644
--- a/charts/redpanda/chart_template_test.go
+++ b/charts/redpanda/chart_template_test.go
@@ -94,7 +94,7 @@ func TestTemplate(t *testing.T) {
// Trailing new lines are added by the txtar format if
// they're not already present. Add one here otherwise
// we'll see failures.
- goldens.AssertGolden(t, testutil.Text, fmt.Sprintf("testdata/%s.yaml.golden", t.Name()), []byte(err.Error() + "\n"))
+ goldens.AssertGolden(t, testutil.Text, fmt.Sprintf("testdata/%s.yaml.golden", t.Name()), []byte(err.Error()+"\n"))
}
Fixed, thanks for looking!
Template tests / golden tests for the redpanda chart were previously a collection of files on disk in the testdata directory. This resulted in very noisey git diffs and git statuses whenever changes to the chart were made and it diverged from the patterns set forth in the console and connectors chart. Adding regression tests was a bit unpleasant as well. They would need to be added as a "no-values.yaml" file or have an elaborate go setup.
This commit refactors the template tests to follow a pattern similar to console and connectors. To make adding new regression tests less painful, a minimal dynamic assertion system has been put in place.
Values files may specify assertions in the form of:
# ASSERT-<NAME> ["OPTIONAL", "PARAMS"]
Which will cause various assertions to run and provides a framework for easily adding new assertions and selectively applying them.