add testing for upgrade --install with subchart notes

Signed-off-by: Jon Leonard <jgleonard@gmail.com>
pull/7830/head
Jon Leonard 5 years ago
parent 00201ffaa8
commit e2b70b2f4b

@ -0,0 +1,11 @@
Release "wacky-bunny" has been upgraded. Happy Helming!
NAME: wacky-bunny
LAST DEPLOYED: Fri Sep 2 22:04:05 1977
NAMESPACE: default
STATUS: deployed
REVISION: 2
TEST SUITE: None
NOTES:
SUBCHART NOTES
PARENT NOTES

@ -0,0 +1,4 @@
apiVersion: v1
description: Chart with subchart notes
name: chart-with-subchart-notes
version: 0.0.1

@ -0,0 +1,4 @@
apiVersion: v1
description: Subchart with notes
name: subchart-with-notes
version: 0.0.1

@ -0,0 +1,3 @@
dependencies:
- name: subchart-with-notes
version: 0.0.1

@ -196,6 +196,38 @@ func TestUpgradeWithStringValue(t *testing.T) {
}
func TestUpgradeInstallWithSubchartNotes(t *testing.T) {
releaseName := "wacky-bunny-v1"
relMock, ch, _ := prepareMockRelease(releaseName, t)
defer resetEnv()()
store := storageFixture()
store.Create(relMock(releaseName, 1, ch))
cmd := fmt.Sprintf("upgrade %s -i --render-subchart-notes '%s'", releaseName, "testdata/testcharts/chart-with-subchart-notes")
_, _, err := executeActionCommandC(store, cmd)
if err != nil {
t.Errorf("unexpected error, got '%v'", err)
}
upgradedRel, err := store.Get(releaseName, 2)
if err != nil {
t.Errorf("unexpected error, got '%v'", err)
}
if !strings.Contains(upgradedRel.Info.Notes, "PARENT NOTES") {
t.Errorf("The parent notes are not set correctly. NOTES: %s", upgradedRel.Info.Notes)
}
if !strings.Contains(upgradedRel.Info.Notes, "SUBCHART NOTES") {
t.Errorf("The subchart notes are not set correctly. NOTES: %s", upgradedRel.Info.Notes)
}
}
func TestUpgradeWithValuesFile(t *testing.T) {
releaseName := "funny-bunny-v4"

Loading…
Cancel
Save