Skip to content

Commit 2d4121d

Browse files
committed
tests: add regression tests, should fail for unquoted globs
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
1 parent bba9c28 commit 2d4121d

2 files changed

Lines changed: 34 additions & 2 deletions

File tree

e2e/tests/pipelines/pipelines.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,34 @@ var _ = DevSpaceDescribe("pipelines", func() {
301301
framework.ExpectNoError(err)
302302
}
303303
})
304+
ginkgo.It("should fail to watch files with unquoted globbing", func(ctx context.Context) {
305+
tempDir, err := framework.CopyToTempDir("tests/pipelines/testdata/run_watch")
306+
framework.ExpectNoError(err)
307+
ginkgo.DeferCleanup(framework.CleanupTempDir, initialDir, tempDir)
308+
309+
ns, err := kubeClient.CreateNamespace("pipelines")
310+
framework.ExpectNoError(err)
311+
ginkgo.DeferCleanup(framework.ExpectDeleteNamespace, kubeClient, ns)
312+
313+
cancelCtx, cancel := context.WithCancel(ctx)
314+
ginkgo.DeferCleanup(cancel)
315+
316+
output := &bytes.Buffer{}
317+
multiWriter := io.MultiWriter(output, os.Stdout)
318+
log := logpkg.NewStreamLogger(multiWriter, multiWriter, logrus.DebugLevel)
319+
320+
devCmd := &cmd.RunPipelineCmd{
321+
GlobalFlags: &flags.GlobalFlags{
322+
NoWarn: true,
323+
Namespace: ns,
324+
},
325+
Pipeline: "unquoted-glob",
326+
Ctx: cancelCtx,
327+
Log: log,
328+
}
329+
err = devCmd.RunDefault(f)
330+
framework.ExpectError(err)
331+
})
304332

305333
ginkgo.It("should use --set and --set-string values from run_pipelines command", func() {
306334
tempDir, err := framework.CopyToTempDir("tests/pipelines/testdata/run_pipelines")

e2e/tests/pipelines/testdata/run_watch/devspace.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,9 @@ pipelines:
3232
--path './foo*/**/*' \
3333
--exclude './foo2/*' \
3434
-- date
35-
36-
35+
36+
unquoted-glob: |-
37+
# Still triggers run_watch for foo2/bar2.txt changes
38+
run_watch \
39+
--path **/* \
40+
-- date

0 commit comments

Comments
 (0)