@@ -10,6 +10,7 @@ import (
1010 "testing"
1111
1212 "github.com/indaco/sley/internal/config"
13+ "github.com/indaco/sley/internal/plugins"
1314 "github.com/indaco/sley/internal/semver"
1415 "github.com/indaco/sley/internal/testutils"
1516 "github.com/indaco/sley/internal/workspace"
@@ -22,7 +23,7 @@ func TestCLI_PreCommand_StaticLabel(t *testing.T) {
2223
2324 // Prepare and run the CLI command
2425 cfg := & config.Config {Path : versionPath }
25- appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg )})
26+ appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg , plugins . NewPluginRegistry () )})
2627
2728 testutils .WriteTempVersionFile (t , tmpDir , "1.2.3" )
2829 testutils .RunCLITest (t , appCli , []string {"sley" , "pre" , "--label" , "beta.1" }, tmpDir )
@@ -39,7 +40,7 @@ func TestCLI_PreCommand_Increment(t *testing.T) {
3940
4041 // Prepare and run the CLI command
4142 cfg := & config.Config {Path : versionPath }
42- appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg )})
43+ appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg , plugins . NewPluginRegistry () )})
4344
4445 testutils .RunCLITest (t , appCli , []string {"sley" , "pre" , "--label" , "beta" , "--inc" }, tmpDir )
4546 content := testutils .ReadTempVersionFile (t , tmpDir )
@@ -54,7 +55,7 @@ func TestCLI_PreCommand_AutoInitFeedback(t *testing.T) {
5455
5556 // Prepare and run the CLI command
5657 cfg := & config.Config {Path : versionPath }
57- appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg )})
58+ appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg , plugins . NewPluginRegistry () )})
5859
5960 output , err := testutils .CaptureStdout (func () {
6061 testutils .RunCLITest (t , appCli , []string {"sley" , "pre" , "--label" , "alpha" }, tmpDir )
@@ -80,7 +81,7 @@ func TestCLI_PreCommand_InvalidVersion(t *testing.T) {
8081
8182 // Prepare and run the CLI command
8283 cfg := & config.Config {Path : defaultPath }
83- appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg )})
84+ appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg , plugins . NewPluginRegistry () )})
8485
8586 err := appCli .Run (context .Background (), []string {
8687 "sley" , "pre" , "--label" , "alpha" , "--path" , customPath ,
@@ -110,7 +111,7 @@ func TestCLI_PreCommand_SaveVersionFails(t *testing.T) {
110111
111112 // Prepare and run the CLI command
112113 cfg := & config.Config {Path : versionPath }
113- appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg )})
114+ appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg , plugins . NewPluginRegistry () )})
114115
115116 err := appCli .Run (context .Background (), []string {
116117 "sley" , "pre" , "--label" , "rc" , "--path" , versionPath ,
@@ -151,7 +152,7 @@ func TestCLI_PreCommand_StaticLabel_Variants(t *testing.T) {
151152 versionPath := filepath .Join (tmpDir , ".version" )
152153
153154 cfg := & config.Config {Path : versionPath }
154- appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg )})
155+ appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg , plugins . NewPluginRegistry () )})
155156
156157 tests := []struct {
157158 name string
@@ -183,7 +184,7 @@ func TestCLI_PreCommand_Increment_Variants(t *testing.T) {
183184 versionPath := filepath .Join (tmpDir , ".version" )
184185
185186 cfg := & config.Config {Path : versionPath }
186- appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg )})
187+ appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg , plugins . NewPluginRegistry () )})
187188
188189 tests := []struct {
189190 name string
@@ -216,7 +217,7 @@ func TestCLI_PreCommand_LabelSwitchWithIncrement(t *testing.T) {
216217 versionPath := filepath .Join (tmpDir , ".version" )
217218
218219 cfg := & config.Config {Path : versionPath }
219- appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg )})
220+ appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg , plugins . NewPluginRegistry () )})
220221
221222 tests := []struct {
222223 name string
@@ -246,7 +247,7 @@ func TestCLI_PreCommand_EdgeCases(t *testing.T) {
246247 versionPath := filepath .Join (tmpDir , ".version" )
247248
248249 cfg := & config.Config {Path : versionPath }
249- appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg )})
250+ appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg , plugins . NewPluginRegistry () )})
250251
251252 tests := []struct {
252253 name string
@@ -295,7 +296,7 @@ func TestCLI_PreCommand_PermissionErrors(t *testing.T) {
295296 versionPath := filepath .Join (protectedDir , ".version" )
296297
297298 cfg := & config.Config {Path : versionPath }
298- appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg )})
299+ appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg , plugins . NewPluginRegistry () )})
299300
300301 err := appCli .Run (context .Background (), []string {
301302 "sley" , "pre" , "--label" , "alpha" , "--path" , versionPath ,
@@ -341,7 +342,7 @@ func TestCLI_PreCommand_MultiModule_All(t *testing.T) {
341342 },
342343 }
343344
344- appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg )})
345+ appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg , plugins . NewPluginRegistry () )})
345346
346347 // Test with --all flag
347348 output , err := testutils .CaptureStdout (func () {
@@ -401,7 +402,7 @@ func TestCLI_PreCommand_MultiModule_Increment(t *testing.T) {
401402 },
402403 }
403404
404- appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg )})
405+ appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg , plugins . NewPluginRegistry () )})
405406
406407 // Test with --all and --inc flags
407408 output , err := testutils .CaptureStdout (func () {
@@ -459,7 +460,7 @@ func TestCLI_PreCommand_MultiModule_Specific(t *testing.T) {
459460 },
460461 }
461462
462- appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg )})
463+ appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg , plugins . NewPluginRegistry () )})
463464
464465 // Test with --module flag to target specific module
465466 testutils .RunCLITest (t , appCli , []string {"sley" , "pre" , "--label" , "alpha" , "--module" , "module-a" }, tmpDir )
@@ -507,7 +508,7 @@ func TestCLI_PreCommand_MultiModule_Quiet(t *testing.T) {
507508 },
508509 }
509510
510- appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg )})
511+ appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg , plugins . NewPluginRegistry () )})
511512
512513 // Test with --quiet flag
513514 output , err := testutils .CaptureStdout (func () {
@@ -562,7 +563,7 @@ func TestCLI_PreCommand_MultiModule_JSONFormat(t *testing.T) {
562563 },
563564 }
564565
565- appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg )})
566+ appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg , plugins . NewPluginRegistry () )})
566567
567568 // Test with --format json
568569 output , err := testutils .CaptureStdout (func () {
@@ -614,7 +615,7 @@ func TestCLI_PreCommand_MultiModule_Parallel(t *testing.T) {
614615 },
615616 }
616617
617- appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg )})
618+ appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg , plugins . NewPluginRegistry () )})
618619
619620 // Test with --parallel flag
620621 testutils .RunCLITest (t , appCli , []string {"sley" , "pre" , "--label" , "alpha" , "--all" , "--parallel" }, tmpDir )
@@ -660,7 +661,7 @@ func TestCLI_PreCommand_MultiModule_TextFormat(t *testing.T) {
660661 },
661662 }
662663
663- appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg )})
664+ appCli := testutils .BuildCLIForTests (cfg .Path , []* cli.Command {Run (cfg , plugins . NewPluginRegistry () )})
664665
665666 // Test with --format text
666667 output , err := testutils .CaptureStdout (func () {
0 commit comments