mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #7990 from heyitsanthony/fix-cov-authfromkeyperm
etcdctl, e2e: use 0xe7cd as argument separator in cov-enabled etcdctl
This commit is contained in:
commit
384a84ceee
@ -56,7 +56,8 @@ func spawnCmd(args []string) (*expect.ExpectProcess, error) {
|
||||
}
|
||||
// avoid test flag conflicts in coverage enabled etcdctl by putting flags in ETCDCTL_ARGS
|
||||
ctl_cov_env := []string{
|
||||
"ETCDCTL_ARGS" + "=" + strings.Join(args, "\xff"),
|
||||
// was \xff, but that's used for testing boundary conditions; 0xe7cd should be safe
|
||||
"ETCDCTL_ARGS=" + strings.Join(args, "\xe7\xcd"),
|
||||
}
|
||||
// when withFlagByEnv() is used in testCtl(), env variables for ctl is set to os.env.
|
||||
// they must be included in ctl_cov_env.
|
||||
|
@ -24,5 +24,5 @@ import (
|
||||
)
|
||||
|
||||
func runCtlV2(app *cli.App) error {
|
||||
return app.Run(strings.Split(os.Getenv("ETCDCTL_ARGS"), "\xff"))
|
||||
return app.Run(strings.Split(os.Getenv("ETCDCTL_ARGS"), "\xe7\xcd"))
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ import (
|
||||
func Start() {
|
||||
// ETCDCTL_ARGS=etcdctl_test arg1 arg2...
|
||||
// SetArgs() takes arg1 arg2...
|
||||
rootCmd.SetArgs(strings.Split(os.Getenv("ETCDCTL_ARGS"), "\xff")[1:])
|
||||
rootCmd.SetArgs(strings.Split(os.Getenv("ETCDCTL_ARGS"), "\xe7\xcd")[1:])
|
||||
if err := rootCmd.Execute(); err != nil {
|
||||
command.ExitWithError(command.ExitError, err)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user