@@ -397,31 +397,34 @@ func TestNewGenerateRunner(t *testing.T) {
397397 {
398398 name : "valid config" ,
399399 cfg : & config.Config {
400- API : "some/api" ,
401- APISource : newTestGitRepo (t ).GetDir (),
402- Repo : newTestGitRepo (t ).GetDir (),
403- WorkRoot : t .TempDir (),
404- Image : "gcr.io/test/test-image" ,
400+ API : "some/api" ,
401+ APISource : newTestGitRepo (t ).GetDir (),
402+ Repo : newTestGitRepo (t ).GetDir (),
403+ WorkRoot : t .TempDir (),
404+ Image : "gcr.io/test/test-image" ,
405+ CommandName : generateCmdName ,
405406 },
406407 },
407408 {
408409 name : "invalid api source" ,
409410 cfg : & config.Config {
410- API : "some/api" ,
411- APISource : t .TempDir (), // Not a git repo
412- Repo : newTestGitRepo (t ).GetDir (),
413- WorkRoot : t .TempDir (),
414- Image : "gcr.io/test/test-image" ,
411+ API : "some/api" ,
412+ APISource : t .TempDir (), // Not a git repo
413+ Repo : newTestGitRepo (t ).GetDir (),
414+ WorkRoot : t .TempDir (),
415+ Image : "gcr.io/test/test-image" ,
416+ CommandName : generateCmdName ,
415417 },
416418 wantErr : true ,
417419 },
418420 {
419421 name : "missing image" ,
420422 cfg : & config.Config {
421- API : "some/api" ,
422- APISource : t .TempDir (),
423- Repo : "https://github.com/googleapis/librarian.git" ,
424- WorkRoot : t .TempDir (),
423+ API : "some/api" ,
424+ APISource : t .TempDir (),
425+ Repo : "https://github.com/googleapis/librarian.git" ,
426+ WorkRoot : t .TempDir (),
427+ CommandName : generateCmdName ,
425428 },
426429 wantErr : true ,
427430 },
@@ -434,37 +437,41 @@ func TestNewGenerateRunner(t *testing.T) {
434437 WorkRoot : t .TempDir (),
435438 Image : "gcr.io/test/test-image" ,
436439 GitHubToken : "gh-token" ,
440+ CommandName : generateCmdName ,
437441 },
438442 },
439443 {
440444 name : "empty API source" ,
441445 cfg : & config.Config {
442- API : "some/api" ,
443- APISource : "" , // This will trigger the clone of googleapis
444- Repo : newTestGitRepo (t ).GetDir (),
445- WorkRoot : t .TempDir (),
446- Image : "gcr.io/test/test-image" ,
446+ API : "some/api" ,
447+ APISource : "" , // This will trigger the clone of googleapis
448+ Repo : newTestGitRepo (t ).GetDir (),
449+ WorkRoot : t .TempDir (),
450+ Image : "gcr.io/test/test-image" ,
451+ CommandName : generateCmdName ,
447452 },
448453 },
449454 {
450455 name : "clone googleapis fails" ,
451456 cfg : & config.Config {
452- API : "some/api" ,
453- APISource : "" , // This will trigger the clone of googleapis
454- Repo : newTestGitRepo (t ).GetDir (),
455- WorkRoot : t .TempDir (),
456- Image : "gcr.io/test/test-image" ,
457+ API : "some/api" ,
458+ APISource : "" , // This will trigger the clone of googleapis
459+ Repo : newTestGitRepo (t ).GetDir (),
460+ WorkRoot : t .TempDir (),
461+ Image : "gcr.io/test/test-image" ,
462+ CommandName : generateCmdName ,
457463 },
458464 wantErr : true ,
459465 },
460466 {
461467 name : "valid config with local repo" ,
462468 cfg : & config.Config {
463- API : "some/api" ,
464- APISource : newTestGitRepo (t ).GetDir (),
465- Repo : newTestGitRepo (t ).GetDir (),
466- WorkRoot : t .TempDir (),
467- Image : "gcr.io/test/test-image" ,
469+ API : "some/api" ,
470+ APISource : newTestGitRepo (t ).GetDir (),
471+ Repo : newTestGitRepo (t ).GetDir (),
472+ WorkRoot : t .TempDir (),
473+ Image : "gcr.io/test/test-image" ,
474+ CommandName : generateCmdName ,
468475 },
469476 },
470477 } {
0 commit comments