From 79746e33be242a770c394d18d2df179f7f3c941d Mon Sep 17 00:00:00 2001 From: Thomas Poignant Date: Wed, 12 Nov 2025 20:33:40 +0000 Subject: [PATCH] chore(cli): Add a test to validate the kebab case error --- cmd/cli/evaluate/evaluate_cmd_test.go | 45 +++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/cmd/cli/evaluate/evaluate_cmd_test.go b/cmd/cli/evaluate/evaluate_cmd_test.go index de9efabdac2..3f52c2b4873 100644 --- a/cmd/cli/evaluate/evaluate_cmd_test.go +++ b/cmd/cli/evaluate/evaluate_cmd_test.go @@ -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) {