New ๐ŸŒŠ wave for @helm

Commit 99c2f316

99c2f316f10cMerged

Sviatoslav Dumchenko <[email protected]> ยท 2 years ago ยท 1 file ยท ~1 modified

Description

chore: add test for remote plandir

Details

Commit
99c2f316f10c
Parent
cf814ef0d07e

pkg/action/build_internal_test.gomodifiedView file

@@ -2,10 +2,12 @@
22
33 import (
44 "context"
5+ "os"
56 "path/filepath"
67 "strings"
78 "testing"
89
10+ "github.com/helmwave/helmwave/pkg/cache"
911 "github.com/helmwave/helmwave/pkg/hooks"
1012 "github.com/helmwave/helmwave/pkg/release"
1113 "github.com/helmwave/helmwave/pkg/release/uniqname"
@@ -387,3 +389,38 @@
387389 var e *hooks.CommandRunError
388390 ts.Require().ErrorAs(err, &e)
389391 }
392+
393+func (ts *NonParallelBuildTestSuite) TestRemoteSource() {
394+ tmpDir := ts.T().TempDir()
395+ d, err := os.Getwd()
396+ ts.Require().NoError(err)
397+
398+ ts.Require().NoError(os.Chdir(tmpDir))
399+ ts.T().Cleanup(func() {
400+ ts.Require().NoError(os.Chdir(d))
401+ })
402+
403+ y := &Yml{
404+ tpl: filepath.Join("tests", "02_helmwave.yml"),
405+ file: filepath.Join("tests", "02_helmwave.yml"),
406+ templater: template.TemplaterSprig,
407+ }
408+
409+ s := &Build{
410+ plandir: plan.Dir,
411+ tags: cli.StringSlice{},
412+ options: plan.BuildOptions{
413+ MatchAll: true,
414+ },
415+ remoteSource: "github.com/helmwave/helmwave",
416+ yml: y,
417+ }
418+
419+ cache.DefaultConfig.Home = ts.T().TempDir()
420+
421+ err = s.Run(context.Background())
422+ ts.Require().NoError(err)
423+
424+ ts.DirExists(filepath.Join(tmpDir, s.plandir))
425+ ts.FileExists(filepath.Join(tmpDir, s.plandir, plan.File))
426+}