@@ -299,6 +299,73 @@ func TestDockerRun(t *testing.T) {
299299 "--source=/source" ,
300300 },
301301 },
302+ {
303+ name : "configure_with_source_roots" ,
304+ docker : & Docker {
305+ Image : testImage ,
306+ },
307+ runCommand : func (ctx context.Context , d * Docker ) error {
308+ configureRequest := & ConfigureRequest {
309+ State : state ,
310+ LibraryID : testLibraryID ,
311+ RepoDir : repoDir ,
312+ ApiRoot : testAPIRoot ,
313+ ExistingSourceRoots : []string {
314+ "a/path" ,
315+ "b/path" ,
316+ },
317+ }
318+
319+ _ , err := d .Configure (ctx , configureRequest )
320+
321+ return err
322+ },
323+ want : []string {
324+ "run" , "--rm" ,
325+ "-v" , fmt .Sprintf ("%s/.librarian:/librarian" , repoDir ),
326+ "-v" , fmt .Sprintf ("%s/.librarian/generator-input:/input" , repoDir ),
327+ "-v" , fmt .Sprintf ("%s:/source:ro" , testAPIRoot ),
328+ "-v" , fmt .Sprintf ("%s/a/path:/repo/a/path:ro" , repoDir ),
329+ "-v" , fmt .Sprintf ("%s/b/path:/repo/b/path:ro" , repoDir ),
330+ testImage ,
331+ string (CommandConfigure ),
332+ "--librarian=/librarian" ,
333+ "--input=/input" ,
334+ "--repo=/repo" ,
335+ "--source=/source" ,
336+ },
337+ },
338+ {
339+ name : "configure_with_nil_source_roots" ,
340+ docker : & Docker {
341+ Image : testImage ,
342+ },
343+ runCommand : func (ctx context.Context , d * Docker ) error {
344+ configureRequest := & ConfigureRequest {
345+ State : state ,
346+ LibraryID : testLibraryID ,
347+ RepoDir : repoDir ,
348+ ApiRoot : testAPIRoot ,
349+ ExistingSourceRoots : nil ,
350+ }
351+
352+ _ , err := d .Configure (ctx , configureRequest )
353+
354+ return err
355+ },
356+ want : []string {
357+ "run" , "--rm" ,
358+ "-v" , fmt .Sprintf ("%s/.librarian:/librarian" , repoDir ),
359+ "-v" , fmt .Sprintf ("%s/.librarian/generator-input:/input" , repoDir ),
360+ "-v" , fmt .Sprintf ("%s:/source:ro" , testAPIRoot ),
361+ testImage ,
362+ string (CommandConfigure ),
363+ "--librarian=/librarian" ,
364+ "--input=/input" ,
365+ "--repo=/repo" ,
366+ "--source=/source" ,
367+ },
368+ },
302369 {
303370 name : "configure_with_multiple_libraries_in_librarian_state" ,
304371 docker : & Docker {
0 commit comments