vitess-gh/go/flagutil
Rohit Nayak 08b91ee65f
[cli] [tabletserver/tabletenv] Migrate tabletenv flags to pflags (#11109)
* Migrate tabletenv flags to pflags

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

Export tabletenv flag registration so that tests that depend on some of those flags can find them. Also the change in logic using pflags allows http query handlers to be registered multiple times: added a sync.Once based fix.

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

Fix TestTxPoolSize which requires flags to be parsed. Also parse flags with local scope in tests so that other parameters like --alsologtostderr don't cause the flag parsing to error

Use _flag.ParseFlagsForTest() instead of cut/pasted code that had beena added for each test

Fix TestHelpOutput

Init tabletenv so that currentConfig equals defaultConfig. Remove unnecessary registration of tabletenv flags in vtadmin test since it can now find the default config values. Also added TestMain to vtadmin tests so that we can run/test individual tests

Address review comments

* Add new flag --queryserver_enable_settings_pool lost in merge

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Move LoadTabletEnvFlags to a separate package for reuse across tests that require tabletenv flags' defaults to be setup.

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Fix failing tests

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Fix merge issue

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2022-09-08 14:18:44 +02:00
..
flagutil.go [cli] [tabletserver/tabletenv] Migrate tabletenv flags to pflags (#11109) 2022-09-08 14:18:44 +02:00
flagutil_test.go add license in /go file 2019-10-21 22:30:02 +08:00
optional.go [cli] [servenv] Migrate flags used by grpc servers to `pflag` (#11165) 2022-09-07 09:05:20 -04:00
sets.go Run latest gofmt on everything & address linter warnings (#11008) 2022-08-16 13:53:42 -07:00