@@ -47,19 +47,19 @@ func TestDeployCommand_AcceptsStackName(t *testing.T) {
4747 assert .NotNil (t , deployCmd .Args , "deploy command should have Args validation set" )
4848}
4949
50- func TestDeployCommand_HasContextFlag (t * testing.T ) {
51- // Test that deploy command has a --context flag
50+ func TestDeployCommand_HasEnvironmentFlag (t * testing.T ) {
51+ // Test that deploy command has a --environment flag
5252 deployCmd := findCommand (rootCmd , "deploy" )
5353 assert .NotNil (t , deployCmd )
5454
55- // Check that --context flag exists
56- contextFlag := deployCmd .Flags ().Lookup ("context " )
57- assert .NotNil (t , contextFlag , "deploy command should have --context flag" )
58- assert .Equal (t , "context " , contextFlag .Name )
55+ // Check that --environment flag exists
56+ environmentFlag := deployCmd .Flags ().Lookup ("environment " )
57+ assert .NotNil (t , environmentFlag , "deploy command should have --environment flag" )
58+ assert .Equal (t , "environment " , environmentFlag .Name )
5959}
6060
61- func TestDeployCommand_RequiresContext (t * testing.T ) {
62- // Test that deploy command requires --context flag
61+ func TestDeployCommand_RequiresEnvironment (t * testing.T ) {
62+ // Test that deploy command requires --environment flag
6363
6464 // Mock deployer that shouldn't be called
6565 mockDeployer := & MockDeployer {}
@@ -68,12 +68,12 @@ func TestDeployCommand_RequiresContext(t *testing.T) {
6868 SetDeployer (mockDeployer )
6969 defer SetDeployer (oldDeployer )
7070
71- // Execute without context flag - should fail
71+ // Execute without environment flag - should fail
7272 rootCmd .SetArgs ([]string {"deploy" , "test-stack" })
7373
7474 err := rootCmd .Execute ()
75- assert .Error (t , err , "deploy command should require --context flag" )
76- assert .Contains (t , err .Error (), "required flag(s) \" context \" not set" )
75+ assert .Error (t , err , "deploy command should require --environment flag" )
76+ assert .Contains (t , err .Error (), "required flag(s) \" environment \" not set" )
7777
7878 // Verify no deployer calls were made
7979 mockDeployer .AssertExpectations (t )
@@ -123,7 +123,7 @@ stacks:
123123 }()
124124
125125 // Execute the root command with deploy subcommand and arguments
126- rootCmd .SetArgs ([]string {"deploy" , "test-stack" , "--context " , "test" })
126+ rootCmd .SetArgs ([]string {"deploy" , "test-stack" , "--environment " , "test" })
127127
128128 // Execute the command - should return error
129129 err = rootCmd .Execute ()
@@ -218,12 +218,12 @@ stacks:
218218 }()
219219
220220 // First deployment should succeed
221- rootCmd .SetArgs ([]string {"deploy" , "stack-1" , "--context " , "test" })
221+ rootCmd .SetArgs ([]string {"deploy" , "stack-1" , "--environment " , "test" })
222222 err = rootCmd .Execute ()
223223 assert .NoError (t , err , "first deployment should succeed" )
224224
225225 // Second deployment should fail
226- rootCmd .SetArgs ([]string {"deploy" , "stack-2" , "--context " , "test" })
226+ rootCmd .SetArgs ([]string {"deploy" , "stack-2" , "--environment " , "test" })
227227 err = rootCmd .Execute ()
228228 assert .Error (t , err , "second deployment should fail" )
229229 assert .Contains (t , err .Error (), "second deployment failed" , "error should contain expected message" )
@@ -288,7 +288,7 @@ stacks:
288288
289289 // Set up mock deployer that expects config-resolved values
290290 mockDeployer := & MockDeployer {}
291- // Expect ResolvedStack with resolved parameters from dev context
291+ // Expect ResolvedStack with resolved parameters from dev environment
292292 mockDeployer .On ("DeployStack" , mock .Anything , mock .MatchedBy (func (resolvedStack * resolve.ResolvedStack ) bool {
293293 return resolvedStack .Name == "vpc" &&
294294 resolvedStack .Parameters ["VpcCidr" ] == "10.1.0.0/16" &&
@@ -310,8 +310,8 @@ stacks:
310310 require .NoError (t , err )
311311 }()
312312
313- // Execute deploy command with context flag
314- rootCmd .SetArgs ([]string {"deploy" , "vpc" , "--context " , "dev" })
313+ // Execute deploy command with environment flag
314+ rootCmd .SetArgs ([]string {"deploy" , "vpc" , "--environment " , "dev" })
315315
316316 err = rootCmd .Execute ()
317317 assert .NoError (t , err , "deploy command should execute successfully with config" )
@@ -396,7 +396,7 @@ stacks:
396396
397397 // This should resolve dependencies and deploy: vpc → database → app
398398 // But current implementation will only deploy app
399- rootCmd .SetArgs ([]string {"deploy" , "app" , "--context " , "test" })
399+ rootCmd .SetArgs ([]string {"deploy" , "app" , "--environment " , "test" })
400400
401401 err = rootCmd .Execute ()
402402 assert .NoError (t , err , "deploy should succeed" )
@@ -472,7 +472,7 @@ stacks:
472472 }()
473473
474474 // Deploy app - should trigger resolver to deploy vpc → database → app
475- rootCmd .SetArgs ([]string {"deploy" , "app" , "--context " , "test" })
475+ rootCmd .SetArgs ([]string {"deploy" , "app" , "--environment " , "test" })
476476
477477 err = rootCmd .Execute ()
478478 assert .NoError (t , err , "deploy should succeed" )
0 commit comments