@@ -458,59 +458,6 @@ func TestAppendUniqueNoValues(t *testing.T) {
458458 assert .Equal (t , []string {"a" , "b" }, result )
459459}
460460
461- func TestApplyPlugins (t * testing.T ) {
462- tests := []struct {
463- name string
464- selected []string
465- templatePaths map [string ][]string
466- expectRemoved []string
467- expectKept []string
468- }{
469- {
470- name : "unselected plugin directory is removed" ,
471- selected : []string {"server" },
472- templatePaths : map [string ][]string {"analytics" : {"config/queries" }},
473- expectRemoved : []string {"config/queries" },
474- },
475- {
476- name : "selected plugin directory is kept" ,
477- selected : []string {"analytics" , "server" },
478- templatePaths : map [string ][]string {"analytics" : {"config/queries" }},
479- expectKept : []string {"config/queries" },
480- },
481- {
482- name : "empty templatePaths is a no-op" ,
483- selected : []string {"server" },
484- templatePaths : map [string ][]string {},
485- },
486- }
487-
488- for _ , tc := range tests {
489- t .Run (tc .name , func (t * testing.T ) {
490- dir := t .TempDir ()
491-
492- // Create all directories referenced in templatePaths
493- for _ , paths := range tc .templatePaths {
494- for _ , p := range paths {
495- require .NoError (t , os .MkdirAll (filepath .Join (dir , p ), 0o755 ))
496- }
497- }
498-
499- err := applyPlugins (dir , tc .selected , tc .templatePaths )
500- require .NoError (t , err )
501-
502- for _ , p := range tc .expectRemoved {
503- _ , statErr := os .Stat (filepath .Join (dir , p ))
504- assert .True (t , os .IsNotExist (statErr ), "expected %s to be removed" , p )
505- }
506- for _ , p := range tc .expectKept {
507- _ , statErr := os .Stat (filepath .Join (dir , p ))
508- assert .NoError (t , statErr , "expected %s to exist" , p )
509- }
510- })
511- }
512- }
513-
514461func TestRunManifestOnlyFound (t * testing.T ) {
515462 dir := t .TempDir ()
516463 manifestPath := filepath .Join (dir , manifest .ManifestFileName )
0 commit comments