Commit f80a7aa3 authored by Sushil Kumar's avatar Sushil Kumar

Added tests for install/upgrade to test bad requirements.yaml

parent 18f900e4
...@@ -138,6 +138,12 @@ func TestInstall(t *testing.T) { ...@@ -138,6 +138,12 @@ func TestInstall(t *testing.T) {
args: []string{"testdata/testcharts/chart-missing-deps"}, args: []string{"testdata/testcharts/chart-missing-deps"},
err: true, err: true,
}, },
// Install, chart with bad requirements.yaml in /charts
{
name: "install chart with bad requirements.yaml",
args: []string{"testdata/testcharts/chart-bad-requirements"},
err: true,
},
} }
runReleaseCases(t, tests, func(c *fakeReleaseClient, out io.Writer) *cobra.Command { runReleaseCases(t, tests, func(c *fakeReleaseClient, out io.Writer) *cobra.Command {
......
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
description: A Helm chart for Kubernetes
name: chart-missing-deps
version: 0.1.0
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
description: A Helm chart for Kubernetes
name: reqsubchart
version: 0.1.0
# Default values for reqsubchart.
# This is a YAML-formatted file.
# Declare name/value pairs to be passed into your templates.
# name: value
dependencies:
- name: reqsubchart
version: 0.1.0
repository: "https://example.com/charts"
# Default values for reqtest.
# This is a YAML-formatted file.
# Declare name/value pairs to be passed into your templates.
# name: value
...@@ -82,6 +82,7 @@ func TestUpgradeCmd(t *testing.T) { ...@@ -82,6 +82,7 @@ func TestUpgradeCmd(t *testing.T) {
originalDepsPath := filepath.Join("testdata/testcharts/reqtest") originalDepsPath := filepath.Join("testdata/testcharts/reqtest")
missingDepsPath := filepath.Join("testdata/testcharts/chart-missing-deps") missingDepsPath := filepath.Join("testdata/testcharts/chart-missing-deps")
badDepsPath := filepath.Join("testdata/testcharts/chart-bad-requirements")
var ch3 *chart.Chart var ch3 *chart.Chart
ch3, err = chartutil.Load(originalDepsPath) ch3, err = chartutil.Load(originalDepsPath)
if err != nil { if err != nil {
...@@ -143,6 +144,12 @@ func TestUpgradeCmd(t *testing.T) { ...@@ -143,6 +144,12 @@ func TestUpgradeCmd(t *testing.T) {
resp: releaseMock(&releaseOptions{name: "bonkers-bunny", version: 1, chart: ch3}), resp: releaseMock(&releaseOptions{name: "bonkers-bunny", version: 1, chart: ch3}),
err: true, err: true,
}, },
{
name: "upgrade a release with bad dependencies",
args: []string{"bonkers-bunny", badDepsPath},
resp: releaseMock(&releaseOptions{name: "bonkers-bunny", version: 1, chart: ch3}),
err: true,
},
} }
cmd := func(c *fakeReleaseClient, out io.Writer) *cobra.Command { cmd := func(c *fakeReleaseClient, out io.Writer) *cobra.Command {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment