@@ -31,6 +31,60 @@ var _ = DevSpaceDescribe("imports", func() {
3131 framework .ExpectNoError (err )
3232 })
3333
34+ ginkgo .It ("should import correctly with variables" , func () {
35+ tempDir , err := framework .CopyToTempDir ("tests/imports/testdata/conditional" )
36+ framework .ExpectNoError (err )
37+ defer framework .CleanupTempDir (initialDir , tempDir )
38+
39+ ns , err := kubeClient .CreateNamespace ("imports" )
40+ framework .ExpectNoError (err )
41+ defer func () {
42+ err := kubeClient .DeleteNamespace (ns )
43+ framework .ExpectNoError (err )
44+ }()
45+
46+ // create a new dev command
47+ deployCmd := & cmd.RunPipelineCmd {
48+ GlobalFlags : & flags.GlobalFlags {
49+ NoWarn : true ,
50+ Namespace : ns ,
51+ Profiles : []string {},
52+ },
53+ Pipeline : "deploy" ,
54+ }
55+
56+ // run the command
57+ err = deployCmd .RunDefault (f )
58+ framework .ExpectNoError (err )
59+
60+ // read temp folder
61+ framework .ExpectLocalFileContentsWithoutSpaces ("import1.txt" , "import1" )
62+
63+ // change path
64+ err = os .Setenv ("IMPORT1_PATH" , "import2.yaml" )
65+ framework .ExpectNoError (err )
66+ defer func () {
67+ _ = os .Unsetenv ("IMPORT1_PATH" )
68+ }()
69+
70+ // create a new dev command
71+ deployCmd = & cmd.RunPipelineCmd {
72+ GlobalFlags : & flags.GlobalFlags {
73+ NoWarn : true ,
74+ Namespace : ns ,
75+ Profiles : []string {},
76+ },
77+ Pipeline : "deploy" ,
78+ }
79+
80+ // run the command
81+ err = deployCmd .RunDefault (f )
82+ framework .ExpectNoError (err )
83+
84+ // read temp folder
85+ framework .ExpectLocalFileContentsWithoutSpaces ("import1.txt" , "import2" )
86+ })
87+
3488 ginkgo .It ("should import correctly" , func () {
3589 tempDir , err := framework .CopyToTempDir ("tests/imports/testdata/local" )
3690 framework .ExpectNoError (err )
0 commit comments