Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions cmd/krel/cmd/changelog_data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ const alphaReleaseExpectedContent = `## Changes by Kind
- The CSR signing cert/key pairs will be reloaded from disk like the kube-apiserver cert/key pairs ([#86816](https://github.com/kubernetes/kubernetes/pull/86816), [@deads2k](https://github.com/deads2k)) [SIG API Machinery, Apps and Auth]
- To reduce chances of throttling, VM cache is set to nil when Azure node provisioning state is deleting ([#87635](https://github.com/kubernetes/kubernetes/pull/87635), [@feiskyer](https://github.com/feiskyer)) [SIG Cloud Provider]`

const alphaReleaseExpectedHTML = `<!DOCTYPE html>
const alphaReleaseExpectedHTMLHead = `<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
Expand All @@ -190,7 +190,9 @@ const alphaReleaseExpectedHTML = `<!DOCTYPE html>
</head>
<body>
<h1>v1.18.0-alpha.3</h1>
<h2>Changelog since v1.19.0-alpha.0</h2>
<h2>Changelog since `

const alphaReleaseExpectedHTMLBottom = `
<h2>Changes by Kind</h2>
<h3>Deprecation</h3>
<ul>
Expand Down
7 changes: 5 additions & 2 deletions cmd/krel/cmd/changelog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ func fileContains(t *testing.T, file, contains string) {
content, err := ioutil.ReadFile(file)
require.Nil(t, err)
require.Contains(t, string(content), contains)
require.Nil(t, os.RemoveAll(file))
}

func TestChangelogNoArgumentsOrFlags(t *testing.T) {
Expand All @@ -67,6 +66,7 @@ func TestNewPatchRelease(t *testing.T) { // nolint: dupl
// Then
// Verify local results
fileContains(t, "CHANGELOG-1.16.html", patchReleaseExpectedHTML)
require.Nil(t, os.RemoveAll("CHANGELOG-1.16.html"))
for _, x := range []struct {
branch string
commitMessage string
Expand Down Expand Up @@ -104,7 +104,9 @@ func TestNewAlphaRelease(t *testing.T) {

// Then
// Verify local results
fileContains(t, "CHANGELOG-1.18.html", alphaReleaseExpectedHTML)
fileContains(t, "CHANGELOG-1.18.html", alphaReleaseExpectedHTMLHead)
fileContains(t, "CHANGELOG-1.18.html", alphaReleaseExpectedHTMLBottom)
require.Nil(t, os.RemoveAll("CHANGELOG-1.18.html"))

// Verify commit message
lastCommit := s.lastCommit(t, git.Master)
Expand Down Expand Up @@ -138,6 +140,7 @@ func TestNewMinorRelease(t *testing.T) { // nolint: dupl
// Then
// Verify local results
fileContains(t, "CHANGELOG-1.17.html", minorReleaseExpectedHTML)
require.Nil(t, os.RemoveAll("CHANGELOG-1.17.html"))
for _, x := range []struct {
branch string
commitMessage string
Expand Down