Signed-off-by: Aurélien Lambert <aure@olli-ai.com>
pull/6876/head
Aurélien Lambert 6 years ago
parent d0df4dc874
commit 3c5a491dcc
No known key found for this signature in database
GPG Key ID: C749F51FF763C5DA

@ -23,11 +23,14 @@ import (
func TestLintCmdWithSubchartsFlag(t *testing.T) { func TestLintCmdWithSubchartsFlag(t *testing.T) {
testChart := "testdata/testcharts/chart-with-bad-subcharts" testChart := "testdata/testcharts/chart-with-bad-subcharts"
// "lint good chart with bad subcharts" only passed in the original version
// because no further test was performed if the templates directory was absent
// The test should have failed.
tests := []cmdTestCase{{ tests := []cmdTestCase{{
name: "lint good chart with bad subcharts", name: "lint good chart with bad subcharts",
cmd: fmt.Sprintf("lint %s", testChart), cmd: fmt.Sprintf("lint %s", testChart),
golden: "output/lint-chart-with-bad-subcharts.txt", golden: "output/lint-chart-with-bad-subcharts.txt",
wantError: false, wantError: true,
}, { }, {
name: "lint good chart with bad subcharts using --with-subcharts flag", name: "lint good chart with bad subcharts using --with-subcharts flag",
cmd: fmt.Sprintf("lint --with-subcharts %s", testChart), cmd: fmt.Sprintf("lint --with-subcharts %s", testChart),

@ -1,6 +1,7 @@
==> Linting testdata/testcharts/chart-with-bad-subcharts ==> Linting testdata/testcharts/chart-with-bad-subcharts
[INFO] Chart.yaml: icon is recommended [INFO] Chart.yaml: icon is recommended
[WARNING] templates/: directory not found [WARNING] templates/: directory not found
[ERROR] : error unpacking bad-subchart in chart-with-bad-subcharts: validation: chart.metadata.name is required
==> Linting testdata/testcharts/chart-with-bad-subcharts/charts/bad-subchart ==> Linting testdata/testcharts/chart-with-bad-subcharts/charts/bad-subchart
[ERROR] Chart.yaml: name is required [ERROR] Chart.yaml: name is required
@ -8,9 +9,10 @@
[ERROR] Chart.yaml: version is required [ERROR] Chart.yaml: version is required
[INFO] Chart.yaml: icon is recommended [INFO] Chart.yaml: icon is recommended
[WARNING] templates/: directory not found [WARNING] templates/: directory not found
[ERROR] : validation: chart.metadata.name is required
==> Linting testdata/testcharts/chart-with-bad-subcharts/charts/good-subchart ==> Linting testdata/testcharts/chart-with-bad-subcharts/charts/good-subchart
[INFO] Chart.yaml: icon is recommended [INFO] Chart.yaml: icon is recommended
[WARNING] templates/: directory not found [WARNING] templates/: directory not found
Error: 3 chart(s) linted, 1 chart(s) failed Error: 3 chart(s) linted, 2 chart(s) failed

@ -1,5 +1,6 @@
==> Linting testdata/testcharts/chart-with-bad-subcharts ==> Linting testdata/testcharts/chart-with-bad-subcharts
[INFO] Chart.yaml: icon is recommended [INFO] Chart.yaml: icon is recommended
[WARNING] templates/: directory not found [WARNING] templates/: directory not found
[ERROR] : error unpacking bad-subchart in chart-with-bad-subcharts: validation: chart.metadata.name is required
1 chart(s) linted, 0 chart(s) failed Error: 1 chart(s) linted, 1 chart(s) failed

Loading…
Cancel
Save