@@ -2,6 +2,7 @@ package pipelines
22
33import (
44 "context"
5+ "github.com/loft-sh/devspace/pkg/devspace/context/values"
56 "io/ioutil"
67 "os"
78 "time"
@@ -33,6 +34,41 @@ var _ = DevSpaceDescribe("pipelines", func() {
3334 framework .ExpectNoError (err )
3435 })
3536
37+ ginkgo .It ("should resolve pipeline flags" , func () {
38+ tempDir , err := framework .CopyToTempDir ("tests/pipelines/testdata/flags" )
39+ framework .ExpectNoError (err )
40+ defer framework .CleanupTempDir (initialDir , tempDir )
41+
42+ ns , err := kubeClient .CreateNamespace ("pipelines" )
43+ framework .ExpectNoError (err )
44+ defer framework .ExpectDeleteNamespace (kubeClient , ns )
45+
46+ devCmd := & cmd.RunPipelineCmd {
47+ GlobalFlags : & flags.GlobalFlags {
48+ NoWarn : true ,
49+ Namespace : ns ,
50+ },
51+ Pipeline : "dev" ,
52+ Ctx : values .WithFlagsMap (context .Background (), map [string ]string {
53+ "test" : "test" ,
54+ "test2" : "" ,
55+ }),
56+ }
57+ err = devCmd .RunDefault (f )
58+ framework .ExpectNoError (err )
59+
60+ framework .ExpectLocalFileContentsImmediately ("test.txt" , "test\n " )
61+ framework .ExpectLocalFileContentsImmediately ("test2.txt" , "\n " )
62+ framework .ExpectLocalFileContentsImmediately ("other.txt" , "test\n " )
63+ framework .ExpectLocalFileContentsImmediately ("other2.txt" , "false\n " )
64+ framework .ExpectLocalFileContentsImmediately ("other3.txt" , "true\n " )
65+ framework .ExpectLocalFileContentsImmediately ("dep1-test.txt" , "test\n " )
66+ framework .ExpectLocalFileContentsImmediately ("dep1-test2.txt" , "true\n " )
67+ framework .ExpectLocalFileContentsImmediately ("dep1-other.txt" , "test\n " )
68+ framework .ExpectLocalFileContentsImmediately ("dep1-other2.txt" , "false\n " )
69+ framework .ExpectLocalFileContentsImmediately ("dep1-other3.txt" , "false\n " )
70+ })
71+
3672 ginkgo .It ("should exec container" , func () {
3773 tempDir , err := framework .CopyToTempDir ("tests/pipelines/testdata/exec_container" )
3874 framework .ExpectNoError (err )
0 commit comments