Test for Linting multiple charts with the same vals instance

Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
This commit is contained in:
Vibhav Bobade
2019-08-17 14:23:22 +05:30
parent 7da1f35386
commit 9ab927f0bb
7 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
apiVersion: v1
name: multiplecharts-lint-chart-1
version: 1
icon: ""

View File

@@ -0,0 +1,6 @@
apiVersion: v1
metadata:
name: multicharttest-chart1-configmap
data:
dat: |
{{ .Values.config | indent 4 }}

View File

@@ -0,0 +1 @@
config: "Test"

View File

@@ -0,0 +1,4 @@
apiVersion: v1
name: multiplecharts-lint-chart-2
version: 1
icon: ""

View File

@@ -0,0 +1,5 @@
apiVersion: v1
metadata:
name: multicharttest-chart2-configmap
data:
{{ toYaml .Values.config | indent 4 }}

View File

@@ -0,0 +1,2 @@
config:
test: "Test"

View File

@@ -31,6 +31,8 @@ var (
chartMissingManifest = "../../cmd/helm/testdata/testcharts/chart-missing-manifest"
chartSchema = "../../cmd/helm/testdata/testcharts/chart-with-schema"
chartSchemaNegative = "../../cmd/helm/testdata/testcharts/chart-with-schema-negative"
chart1MultipleChartLint = "../../cmd/helm/testdata/testcharts/multiplecharts-lint-chart-1"
chart2MultipleChartLint = "../../cmd/helm/testdata/testcharts/multiplecharts-lint-chart-2"
)
func TestLintChart(t *testing.T) {
@@ -56,3 +58,12 @@ func TestLintChart(t *testing.T) {
t.Error(err)
}
}
func TestLint_MultipleCharts(t *testing.T) {
testCharts := []string{chart2MultipleChartLint, chart1MultipleChartLint}
testLint := NewLint()
if result := testLint.Run(testCharts, values); len(result.Errors) == 0 {
t.Error(result.Errors)
}
}