MCPcopy
hub / github.com/grafana/tempo / TestCustomSummary

Function TestCustomSummary

tools/chloggen/internal/chlog/summary_test.go:141–164  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

139}
140
141func TestCustomSummary(t *testing.T) {
142 brk1 := Entry{
143 ChangeType: Breaking,
144 Component: "foo",
145 Note: "broke foo",
146 Issues: []int{123},
147 }
148 brk2 := Entry{
149 ChangeType: Breaking,
150 Component: "bar",
151 Note: "broke bar",
152 Issues: []int{345, 678},
153 SubText: "more details",
154 }
155
156 actual, err := GenerateSummary("1.0", []*Entry{&brk1, &brk2}, &config.Config{SummaryTemplate: filepath.Join("testdata", "custom.tmpl")})
157 require.NoError(t, err)
158
159 // This file is not meant to be the entire changelog so will not pass markdownlint if named with .md extension.
160 expected, err := os.ReadFile(filepath.Join("testdata", "CHANGELOG_custom"))
161 require.NoError(t, err)
162
163 assert.Equal(t, string(expected), actual)
164}

Callers

nothing calls this directly

Calls 3

GenerateSummaryFunction · 0.85
JoinMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected