Skip to content

Commit 8f41e06

Browse files
fix tests
1 parent 220e23b commit 8f41e06

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ require (
1313
github.com/spf13/viper v1.19.0
1414
github.com/stretchr/testify v1.10.0
1515
golang.org/x/oauth2 v0.24.0
16-
golang.org/x/text v0.21.0
1716
gopkg.in/yaml.v3 v3.0.1
1817
)
1918

@@ -40,6 +39,7 @@ require (
4039
golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f // indirect
4140
golang.org/x/net v0.24.0 // indirect
4241
golang.org/x/sys v0.19.0 // indirect
42+
golang.org/x/text v0.21.0 // indirect
4343
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
4444
gopkg.in/ini.v1 v1.67.0 // indirect
4545
gopkg.in/yaml.v2 v2.4.0 // indirect

internal/changelog/fragment/creator_internal_test.go

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ func TestCreate(t *testing.T) {
7474
content, err := afero.ReadFile(fc.fs, path.Join(fc.location, fc.filename("foobar")))
7575
require.Nil(t, err)
7676

77-
expected := `# Kind can be one of:
77+
expected := `# REQUIRED
78+
# Kind can be one of:
7879
# - breaking-change: a change to previously-documented behavior
7980
# - deprecation: functionality that is being removed in a later release
8081
# - bug-fix: fixes a problem in a previous version
@@ -86,26 +87,38 @@ func TestCreate(t *testing.T) {
8687
# - other: does not fit into any of the other categories
8788
kind: feature
8889
90+
# REQUIRED for all kinds
8991
# Change summary; a 80ish characters long description of the change.
9092
summary: foobar
9193
94+
# REQUIRED for breaking-change, deprecation, known-issue
9295
# Long description; in case the summary is not enough to describe the change
9396
# this field accommodate a description without length limits.
94-
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
95-
#description:
97+
# description:
9698
99+
# REQUIRED for breaking-change, deprecation, known-issue
100+
# impact:
101+
102+
# REQUIRED for breaking-change, deprecation, known-issue
103+
# action:
104+
105+
# REQUIRED for all kinds
97106
# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
98107
component:
99108
100-
# PR URL; optional; the PR number that added the changeset.
109+
# AUTOMATED
110+
# OPTIONAL to manually add other PR URLs
111+
# PR URL: A link the PR that added the changeset.
101112
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
102113
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
103114
# Please provide it if you are adding a fragment for a different PR.
104-
#pr: https://github.com/owner/repo/1234
115+
# pr: https://github.com/owner/repo/1234
105116
117+
# AUTOMATED
118+
# OPTIONAL to manually add other issue URLs
106119
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
107120
# If not present is automatically filled by the tooling with the issue linked to the PR number.
108-
#issue: https://github.com/owner/repo/1234
121+
# issue: https://github.com/owner/repo/1234
109122
`
110123
got := string(content)
111124
assert.Equal(t, expected, got, `This test exists to force review on changes to the Changelog Fragment template, as changing the template may introduce breaking changes.

internal/changelog/renderer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func TestRenderer(t *testing.T) {
3434
c, err := changelog.FromFile(fs, inFile)
3535
require.NoError(t, err)
3636

37-
r := changelog.NewRenderer(fs, c, dest, "asciidoc-embedded")
37+
r := changelog.NewRenderer(fs, c, dest, "asciidoc-embedded", "elastic-agent")
3838

3939
err = r.Render()
4040
require.Nil(t, err)

0 commit comments

Comments
 (0)