Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
keroxp committed Jun 17, 2024
1 parent ff7d0aa commit 061d97e
Show file tree
Hide file tree
Showing 7 changed files with 192 additions and 148 deletions.
12 changes: 9 additions & 3 deletions cli/cage/commands/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,25 @@ func TestCommands(t *testing.T) {
t.Run("rollout", func(t *testing.T) {
t.Run("basic", func(t *testing.T) {
app, cagecli := setup(t, stdinService)
cagecli.EXPECT().RollOut(gomock.Any(), gomock.Any()).Return(&cage.RollOutResult{}, nil)
cagecli.EXPECT().RollOut(gomock.Any(), &cage.RollOutInput{}).Return(&cage.RollOutResult{}, nil)
err := app.Run([]string{"cage", "rollout", "--region", "ap-notheast-1", "../../../fixtures"})
assert.NoError(t, err)
})
t.Run("basic/ci", func(t *testing.T) {
app, cagecli := setup(t, "")
cagecli.EXPECT().RollOut(gomock.Any(), gomock.Any()).Return(&cage.RollOutResult{}, nil)
cagecli.EXPECT().RollOut(gomock.Any(), &cage.RollOutInput{}).Return(&cage.RollOutResult{}, nil)
err := app.Run([]string{"cage", "rollout", "--region", "ap-notheast-1", "../../../fixtures"})
assert.NoError(t, err)
})
t.Run("basic/udate-service", func(t *testing.T) {
app, cagecli := setup(t, stdinService)
cagecli.EXPECT().RollOut(gomock.Any(), &cage.RollOutInput{UpdateService: true}).Return(&cage.RollOutResult{}, nil)
err := app.Run([]string{"cage", "rollout", "--region", "ap-notheast-1", "--updateService", "../../../fixtures"})
assert.NoError(t, err)
})
t.Run("error", func(t *testing.T) {
app, cagecli := setup(t, stdinService)
cagecli.EXPECT().RollOut(gomock.Any(), gomock.Any()).Return(&cage.RollOutResult{}, fmt.Errorf("error"))
cagecli.EXPECT().RollOut(gomock.Any(), &cage.RollOutInput{}).Return(&cage.RollOutResult{}, fmt.Errorf("error"))
err := app.Run([]string{"cage", "rollout", "--region", "ap-notheast-1", "../../../fixtures"})
assert.EqualError(t, err, "error")
})
Expand Down
14 changes: 0 additions & 14 deletions fixtures/envars.json

This file was deleted.

4 changes: 2 additions & 2 deletions fixtures/service.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
},
"networkConfiguration": {
"awsvpcConfiguration": {
"subnets": [""],
"securityGroups": [""],
"subnets": ["subnet-111", "subnet-222"],
"securityGroups": ["sg-111", "sg-222"],
"assignPublicIp": "ENABLED"
}
},
Expand Down
Loading

0 comments on commit 061d97e

Please sign in to comment.