laskoviymishka commented on code in PR #2710:
URL: https://github.com/apache/iceberg-go/pull/2710#discussion_r4735266002
##########
cmd/iceberg/args_test.go:
##########
@@ -389,6 +389,23 @@ func TestCLIExplicitMissingConfigFailsBeforeCatalogInit(t
*testing.T) {
assert.Contains(t, string(out), path)
}
+func TestCLIRejectsUnknownOutput(t *testing.T) {
+ if testing.Short() {
+ t.Skip("spawns a subprocess")
+ }
+
+ home := t.TempDir()
+ cmd := exec.Command(os.Args[0], "--output", "yaml", "list")
Review Comment:
Could we also cover an invalid `output:` coming from the config file?
[`TestMergeConf`](https://github.com/apache/iceberg-go/blob/0d570a90f8beff5a8576b35d1bee245d36d655c8/cmd/iceberg/args_test.go#L615-L658)
never sets `Output`, so the config-to-`args.Output` path that also reaches
this error has no test.
##########
cmd/iceberg/main.go:
##########
@@ -298,7 +298,7 @@ func main() {
case "json":
output = jsonOutput{}
default:
- logFatal("unimplemented output type")
+ logFatalf("unsupported --output value %q (supported values:
json, text)", args.Output)
Review Comment:
Could the message drop the flag name, e.g. `unsupported output value %q`?
`args.Output` can also come from the config file's `output:` key
([`mergeConf`](https://github.com/apache/iceberg-go/blob/0d570a90f8beff5a8576b35d1bee245d36d655c8/cmd/iceberg/main.go#L958-L959)),
so `output: yaml` there gets reported as an unsupported `--output` value.
`main`'s `unimplemented output type` didn't name a source.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]