コード例 #1
0
ファイル: lint_test.go プロジェクト: helm/helm-classic
func TestLintMissingManifestDirectory(t *testing.T) {
	tmpHome := test.CreateTmpHome()
	test.FakeUpdate(tmpHome)

	chartName := "brokeChart"

	Create(chartName, tmpHome)

	os.RemoveAll(filepath.Join(util.WorkspaceChartDirectory(tmpHome, chartName), "manifests"))

	output := test.CaptureOutput(func() {
		Lint(util.WorkspaceChartDirectory(tmpHome, chartName))
	})

	test.ExpectMatches(t, output, "Manifests directory is present : false")
	test.ExpectContains(t, output, "Chart ["+chartName+"] has failed some necessary checks")
}
コード例 #2
0
ファイル: lint_test.go プロジェクト: helm/helm-classic
func TestLintAll(t *testing.T) {
	tmpHome := test.CreateTmpHome()
	test.FakeUpdate(tmpHome)

	missingReadmeChart := "missingReadme"

	action.Create(missingReadmeChart, tmpHome)
	os.Remove(util.WorkspaceChartDirectory(tmpHome, missingReadmeChart, "README.md"))

	action.Create("goodChart", tmpHome)

	output := test.CaptureOutput(func() {
		Cli().Run([]string{"helmc", "--home", tmpHome, "lint", "--all"})
	})

	test.ExpectMatches(t, output, "A README file was not found.*"+missingReadmeChart)
	test.ExpectContains(t, output, "Chart [goodChart] has passed all necessary checks")
	test.ExpectContains(t, output, "Chart [missingReadme] failed some checks")
}