Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions cmd/cli/evaluate/evaluate_cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,51 @@ func TestCmdEvaluate(t *testing.T) {
wantErr: assert.Error,
expectedErr: "impossible to init flagset retriever: cannot parse `inv4lid`: failed to parse as keyword/value (invalid keyword/value)",
},
{
name: "should return RetrieverConfError with CLI-friendly message when required property is missing",
args: []string{
"--kind",
"github",
"--path",
"testdata/flag-config.yaml",
"--branch",
"master",
"--ctx",
`{"targetingKey": "user-123"}`,
"--format",
"yaml",
},
wantErr: assert.Error,
expectedErr: "invalid retriever: no \"repository-slug\" property found for kind \"github\"",
},
{
name: "should return RetrieverConfError with CLI-friendly message when path is missing for file kind",
args: []string{
"--kind",
"file",
"--ctx",
`{"targetingKey": "user-123"}`,
"--format",
"yaml",
},
wantErr: assert.Error,
expectedErr: "invalid retriever: no \"path\" property found for kind \"file\"",
},
{
name: "should return RetrieverConfError with CLI-friendly message when bucket is missing for s3 kind",
args: []string{
"--kind",
"s3",
"--item",
"config.yaml",
"--ctx",
`{"targetingKey": "user-123"}`,
"--format",
"yaml",
},
wantErr: assert.Error,
expectedErr: "invalid retriever: no \"bucket\" property found for kind \"s3\"",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
Loading