mirror of
https://github.com/helm/helm.git
synced 2026-08-05 23:51:03 +00:00
Added tests for install/upgrade to test bad requirements.yaml
This commit is contained in:
@@ -138,6 +138,12 @@ func TestInstall(t *testing.T) {
|
||||
args: []string{"testdata/testcharts/chart-missing-deps"},
|
||||
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 {
|
||||
|
||||
21
cmd/helm/testdata/testcharts/chart-bad-requirements/.helmignore
vendored
Normal file
21
cmd/helm/testdata/testcharts/chart-bad-requirements/.helmignore
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# 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
|
||||
3
cmd/helm/testdata/testcharts/chart-bad-requirements/Chart.yaml
vendored
Normal file
3
cmd/helm/testdata/testcharts/chart-bad-requirements/Chart.yaml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
description: A Helm chart for Kubernetes
|
||||
name: chart-missing-deps
|
||||
version: 0.1.0
|
||||
21
cmd/helm/testdata/testcharts/chart-bad-requirements/charts/reqsubchart/.helmignore
vendored
Normal file
21
cmd/helm/testdata/testcharts/chart-bad-requirements/charts/reqsubchart/.helmignore
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# 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
|
||||
3
cmd/helm/testdata/testcharts/chart-bad-requirements/charts/reqsubchart/Chart.yaml
vendored
Normal file
3
cmd/helm/testdata/testcharts/chart-bad-requirements/charts/reqsubchart/Chart.yaml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
description: A Helm chart for Kubernetes
|
||||
name: reqsubchart
|
||||
version: 0.1.0
|
||||
4
cmd/helm/testdata/testcharts/chart-bad-requirements/charts/reqsubchart/values.yaml
vendored
Normal file
4
cmd/helm/testdata/testcharts/chart-bad-requirements/charts/reqsubchart/values.yaml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# Default values for reqsubchart.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare name/value pairs to be passed into your templates.
|
||||
# name: value
|
||||
4
cmd/helm/testdata/testcharts/chart-bad-requirements/requirements.yaml
vendored
Normal file
4
cmd/helm/testdata/testcharts/chart-bad-requirements/requirements.yaml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
dependencies:
|
||||
- name: reqsubchart
|
||||
version: 0.1.0
|
||||
repository: "https://example.com/charts"
|
||||
4
cmd/helm/testdata/testcharts/chart-bad-requirements/values.yaml
vendored
Normal file
4
cmd/helm/testdata/testcharts/chart-bad-requirements/values.yaml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# 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) {
|
||||
|
||||
originalDepsPath := filepath.Join("testdata/testcharts/reqtest")
|
||||
missingDepsPath := filepath.Join("testdata/testcharts/chart-missing-deps")
|
||||
badDepsPath := filepath.Join("testdata/testcharts/chart-bad-requirements")
|
||||
var ch3 *chart.Chart
|
||||
ch3, err = chartutil.Load(originalDepsPath)
|
||||
if err != nil {
|
||||
@@ -143,6 +144,12 @@ func TestUpgradeCmd(t *testing.T) {
|
||||
resp: releaseMock(&releaseOptions{name: "bonkers-bunny", version: 1, chart: ch3}),
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user