Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
mpanchajanya committed Mar 13, 2024
1 parent c74c315 commit ab57246
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
2 changes: 0 additions & 2 deletions pkg/cli/plugin_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,6 @@ func processPluginArgs(p *PluginInfo, args []string) (known []string, err error)
}
}

fmt.Println("known", known)

return known, err
}

Expand Down
2 changes: 2 additions & 0 deletions pkg/command/discovery_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ func Test_createAndListDiscoverySources(t *testing.T) {
testSource2 := "localhost:9876/tanzu-cli/plugins/sandbox1:small"
os.Setenv(constants.ConfigVariableAdditionalDiscoveryForTesting, testSource1+","+testSource2)

rootCmd, err = NewRootCmd()
assert.Nil(err)
rootCmd.SetArgs([]string{"plugin", "source", "list"})
b = bytes.NewBufferString("")
rootCmd.SetOut(b)
Expand Down
20 changes: 9 additions & 11 deletions pkg/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,6 @@ func newRootCmd() *cobra.Command {
// silencing usage for now as we are getting double usage from plugins on errors
SilenceUsage: true,
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
fmt.Println(args, "args", verbose)

// Validate the verbose flag
if verbose < 0 || verbose > 9 {
return errors.New("Invalid value for verbose flag. It should be between 0 and 9")
Expand All @@ -272,20 +270,20 @@ func newRootCmd() *cobra.Command {
}
}

log.Infof("verbose %v", verbose)
//log.Infof("verbose %v", verbose)

Check failure on line 273 in pkg/command/root.go

View workflow job for this annotation

GitHub Actions / Build

commentFormatting: put a space between `//` and comment text (gocritic)

// Sets the verbosity of the logger
setLoggerVerbosity(verbose)

//TODO: Remove test logs
log.Info("I am level default")
log.V(0).Info("I am level 0")
log.V(1).Info("I am level 1")
log.V(2).Info("I am level 2")
log.V(3).Info("I am level 3")
log.V(4).Info("I am level 4")
log.V(5).Info("I am level 5")
log.V(6).Info("I am level 6")
//log.Info("I am level default")

Check failure on line 279 in pkg/command/root.go

View workflow job for this annotation

GitHub Actions / Build

commentFormatting: put a space between `//` and comment text (gocritic)
//log.V(0).Info("I am level 0")
//log.V(1).Info("I am level 1")
//log.V(2).Info("I am level 2")
//log.V(3).Info("I am level 3")
//log.V(4).Info("I am level 4")
//log.V(5).Info("I am level 5")
//log.V(6).Info("I am level 6")

// Ensure mutual exclusion in current contexts just in case if any plugins with old
// plugin-runtime sets k8s context as current when tanzu context is already set as current
Expand Down

0 comments on commit ab57246

Please sign in to comment.