chore(test): Use fs.RenameWithFallback

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
pull/9393/head
Josh Soref 5 years ago
parent 5dee27c2e8
commit a8def027d9

@ -25,6 +25,7 @@ import (
"github.com/Masterminds/goutils" "github.com/Masterminds/goutils"
"helm.sh/helm/v3/internal/test/ensure" "helm.sh/helm/v3/internal/test/ensure"
"helm.sh/helm/v3/internal/third_party/dep/fs"
"helm.sh/helm/v3/pkg/chart" "helm.sh/helm/v3/pkg/chart"
"helm.sh/helm/v3/pkg/chartutil" "helm.sh/helm/v3/pkg/chartutil"
"helm.sh/helm/v3/pkg/lint/support" "helm.sh/helm/v3/pkg/lint/support"
@ -75,8 +76,8 @@ var ignoredTemplatePath = filepath.Join(templateTestBasedir, "fail.yaml.ignored"
// namespaces, partial templates // namespaces, partial templates
func TestTemplateIntegrationHappyPath(t *testing.T) { func TestTemplateIntegrationHappyPath(t *testing.T) {
// Rename file so it gets ignored by the linter // Rename file so it gets ignored by the linter
os.Rename(wrongTemplatePath, ignoredTemplatePath) fs.RenameWithFallback(wrongTemplatePath, ignoredTemplatePath)
defer os.Rename(ignoredTemplatePath, wrongTemplatePath) defer fs.RenameWithFallback(ignoredTemplatePath, wrongTemplatePath)
linter := support.Linter{ChartDir: templateTestBasedir} linter := support.Linter{ChartDir: templateTestBasedir}
Templates(&linter, values, namespace, strict) Templates(&linter, values, namespace, strict)

Loading…
Cancel
Save