@@ -288,36 +288,36 @@ var _ = Describe("CLI Service", func() {
288
288
Context ("when 'base' is missing" , func () {
289
289
var originalSpecifiedFileContent string
290
290
var receivedSpecifiedFileContent string
291
+ var receivedMintDirectoryFileContent string
291
292
292
293
BeforeEach (func () {
293
294
originalSpecifiedFileContent = "tasks:\n - key: foo\n run: echo 'bar'\n "
294
295
295
296
var err error
296
297
297
- workingDir := filepath .Join (tmp , "some" , "path" , "to" , "working" , "directory" )
298
- err = os .MkdirAll (workingDir , 0o755 )
299
- Expect (err ).NotTo (HaveOccurred ())
300
-
301
- err = os .Chdir (workingDir )
298
+ mintDir := filepath .Join (tmp , ".mint" )
299
+ err = os .MkdirAll (mintDir , 0o755 )
302
300
Expect (err ).NotTo (HaveOccurred ())
303
301
304
- err = os .WriteFile (filepath .Join (workingDir , "mint .yml" ), []byte (originalSpecifiedFileContent ), 0o644 )
302
+ err = os .WriteFile (filepath .Join (mintDir , "foo .yml" ), []byte (originalSpecifiedFileContent ), 0o644 )
305
303
Expect (err ).NotTo (HaveOccurred ())
306
304
307
- runConfig .MintFilePath = "mint.yml"
308
- runConfig .MintDirectory = ""
305
+ runConfig .MintFilePath = ". mint/foo .yml"
306
+ runConfig .MintDirectory = ".mint "
309
307
310
308
mockAPI .MockInitiateRun = func (cfg api.InitiateRunConfig ) (* api.InitiateRunResult , error ) {
311
309
Expect (cfg .TaskDefinitions ).To (HaveLen (1 ))
312
310
Expect (cfg .TaskDefinitions [0 ].Path ).To (Equal (runConfig .MintFilePath ))
313
- Expect (cfg .MintDirectory ).To (HaveLen (0 ))
311
+ Expect (cfg .MintDirectory ).To (HaveLen (2 ))
314
312
Expect (cfg .UseCache ).To (BeTrue ())
315
313
receivedSpecifiedFileContent = cfg .TaskDefinitions [0 ].FileContents
314
+ receivedMintDirectoryFileContent = cfg .MintDirectory [1 ].FileContents
315
+
316
316
return & api.InitiateRunResult {
317
317
RunId : "785ce4e8-17b9-4c8b-8869-a55e95adffe7" ,
318
318
RunURL : "https://cloud.rwx.com/mint/rwx/runs/785ce4e8-17b9-4c8b-8869-a55e95adffe7" ,
319
319
TargetedTaskKeys : []string {},
320
- DefinitionPath : ".mint/mint .yml" ,
320
+ DefinitionPath : ".mint/foo .yml" ,
321
321
}, nil
322
322
}
323
323
})
@@ -335,8 +335,12 @@ var _ = Describe("CLI Service", func() {
335
335
Expect (receivedSpecifiedFileContent ).To (Equal (fmt .Sprintf ("%s\n %s" , baseSpec , originalSpecifiedFileContent )))
336
336
})
337
337
338
+ It ("passes the updated file content in the mint directory artifact" , func () {
339
+ Expect (receivedMintDirectoryFileContent ).To (Equal (fmt .Sprintf ("%s\n %s" , baseSpec , originalSpecifiedFileContent )))
340
+ })
341
+
338
342
It ("prints a warning" , func () {
339
- Expect (mockStderr .String ()).To (ContainSubstring ("Configured \" mint.yml\" to run on ubuntu 24.04\n " ))
343
+ Expect (mockStderr .String ()).To (ContainSubstring ("Configured \" . mint/foo .yml\" to run on ubuntu 24.04\n " ))
340
344
})
341
345
})
342
346
})
@@ -1790,7 +1794,7 @@ AAAEC6442PQKevgYgeT0SIu9zwlnEMl6MF59ZgM+i0ByMv4eLJPqG3xnZcEQmktHj/GY2i
1790
1794
1791
1795
Expect (err ).NotTo (HaveOccurred ())
1792
1796
Expect (mockStderr .String ()).To (Equal ("" ))
1793
- Expect (mockStdout .String ()).To (ContainSubstring ("No run files found " ))
1797
+ Expect (mockStdout .String ()).To (ContainSubstring ("No run files needed to be updated " ))
1794
1798
})
1795
1799
})
1796
1800
0 commit comments