Skip to content

Commit

Permalink
update mmctl to release 6.2 (#413)
Browse files Browse the repository at this point in the history
* update mmctl to release 6.2
  • Loading branch information
Carlos Tadeu Panato Junior committed Nov 26, 2021
1 parent 5c31b25 commit 8ab71ce
Show file tree
Hide file tree
Showing 1,279 changed files with 46,077 additions and 28,066 deletions.
22 changes: 11 additions & 11 deletions commands/plugin_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ func (s *MmctlE2ETestSuite) TestPluginAddCmd() {

// teardown
pInfo := plugins.Inactive[0]
appErr = s.th.App.RemovePlugin(pInfo.Id)
s.Require().Nil(appErr)
err = pluginDeleteCmdF(c, &cobra.Command{}, []string{pInfo.Id})
s.Require().Nil(err)
})

s.RunForSystemAdminAndLocal("add an already installed plugin with force", func(c client.Client) {
Expand Down Expand Up @@ -98,8 +98,8 @@ func (s *MmctlE2ETestSuite) TestPluginAddCmd() {

// teardown
pInfo := plugins.Inactive[0]
appErr = s.th.App.RemovePlugin(pInfo.Id)
s.Require().Nil(appErr)
err = pluginDeleteCmdF(c, &cobra.Command{}, []string{pInfo.Id})
s.Require().Nil(err)
})

s.RunForSystemAdminAndLocal("admin and local can't add plugins if the config doesn't allow it", func(c client.Client) {
Expand Down Expand Up @@ -136,8 +136,8 @@ func (s *MmctlE2ETestSuite) TestPluginAddCmd() {

// teardown
pInfo := res.Inactive[0]
appErr = s.th.App.RemovePlugin(pInfo.Id)
s.Require().Nil(appErr)
err = pluginDeleteCmdF(c, &cobra.Command{}, []string{pInfo.Id})
s.Require().Nil(err)
})

s.Run("normal user can't add plugin", func() {
Expand Down Expand Up @@ -176,8 +176,8 @@ func (s *MmctlE2ETestSuite) TestPluginInstallURLCmd() {

s.RunForSystemAdminAndLocal("install new plugins", func(c client.Client) {
printer.Clean()
defer removePluginIfInstalled(s, jiraPluginID)
defer removePluginIfInstalled(s, githubPluginID)
defer removePluginIfInstalled(c, s, jiraPluginID)
defer removePluginIfInstalled(c, s, githubPluginID)

err := pluginInstallURLCmdF(c, &cobra.Command{}, []string{jiraURL, githubURL})
s.Require().Nil(err)
Expand All @@ -194,7 +194,7 @@ func (s *MmctlE2ETestSuite) TestPluginInstallURLCmd() {

s.Run("install a plugin without permissions", func() {
printer.Clean()
defer removePluginIfInstalled(s, jiraPluginID)
defer removePluginIfInstalled(s.th.Client, s, jiraPluginID)

err := pluginInstallURLCmdF(s.th.Client, &cobra.Command{}, []string{jiraURL})
s.Require().Nil(err)
Expand Down Expand Up @@ -229,7 +229,7 @@ func (s *MmctlE2ETestSuite) TestPluginInstallURLCmd() {

s.RunForSystemAdminAndLocal("install an already installed plugin without force", func(c client.Client) {
printer.Clean()
defer removePluginIfInstalled(s, jiraPluginID)
defer removePluginIfInstalled(c, s, jiraPluginID)

err := pluginInstallURLCmdF(c, &cobra.Command{}, []string{jiraURL})
s.Require().Nil(err)
Expand All @@ -252,7 +252,7 @@ func (s *MmctlE2ETestSuite) TestPluginInstallURLCmd() {

s.RunForSystemAdminAndLocal("install an already installed plugin with force", func(c client.Client) {
printer.Clean()
defer removePluginIfInstalled(s, jiraPluginID)
defer removePluginIfInstalled(c, s, jiraPluginID)

err := pluginInstallURLCmdF(c, &cobra.Command{}, []string{jiraURL})
s.Require().Nil(err)
Expand Down
14 changes: 7 additions & 7 deletions commands/plugin_marketplace_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (s *MmctlE2ETestSuite) TestPluginMarketplaceInstallCmd() {
pluginID := plugin.Manifest.Id
pluginVersion := plugin.Manifest.Version

defer removePluginIfInstalled(s, pluginID)
defer removePluginIfInstalled(c, s, pluginID)

err := pluginMarketplaceInstallCmdF(c, &cobra.Command{}, []string{pluginID, pluginVersion})
s.Require().Nil(err)
Expand All @@ -58,7 +58,7 @@ func (s *MmctlE2ETestSuite) TestPluginMarketplaceInstallCmd() {
pluginVersion = "3.0.0"
)

defer removePluginIfInstalled(s, pluginID)
defer removePluginIfInstalled(s.th.Client, s, pluginID)

err := pluginMarketplaceInstallCmdF(s.th.Client, &cobra.Command{}, []string{pluginID, pluginVersion})
s.Require().NotNil(err)
Expand All @@ -79,7 +79,7 @@ func (s *MmctlE2ETestSuite) TestPluginMarketplaceInstallCmd() {
pluginID = "jira"
)

defer removePluginIfInstalled(s, pluginID)
defer removePluginIfInstalled(c, s, pluginID)

err := pluginMarketplaceInstallCmdF(c, &cobra.Command{}, []string{pluginID})
s.Require().Nil(err)
Expand All @@ -106,7 +106,7 @@ func (s *MmctlE2ETestSuite) TestPluginMarketplaceInstallCmd() {
pluginVersion = "invalid-version"
)

defer removePluginIfInstalled(s, pluginID)
defer removePluginIfInstalled(c, s, pluginID)

err := pluginMarketplaceInstallCmdF(c, &cobra.Command{}, []string{pluginID, pluginVersion})
s.Require().NotNil(err)
Expand All @@ -127,7 +127,7 @@ func (s *MmctlE2ETestSuite) TestPluginMarketplaceInstallCmd() {
pluginID = "a-nonexistent-plugin"
)

defer removePluginIfInstalled(s, pluginID)
defer removePluginIfInstalled(c, s, pluginID)

err := pluginMarketplaceInstallCmdF(c, &cobra.Command{}, []string{pluginID})
s.Require().NotNil(err)
Expand All @@ -142,8 +142,8 @@ func (s *MmctlE2ETestSuite) TestPluginMarketplaceInstallCmd() {
})
}

func removePluginIfInstalled(s *MmctlE2ETestSuite, pluginID string) {
appErr := s.th.App.RemovePlugin(pluginID)
func removePluginIfInstalled(c client.Client, s *MmctlE2ETestSuite, pluginID string) {
appErr := pluginDeleteCmdF(c, &cobra.Command{}, []string{pluginID})
if appErr != nil {
s.Require().Contains(appErr.Error(), "Plugin is not installed.")
}
Expand Down
2 changes: 1 addition & 1 deletion commands/team_users_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (s *MmctlE2ETestSuite) TestTeamUserAddCmd() {
if teamMember == nil {
return nil
}
return s.th.App.RemoveTeamMemberFromTeam(s.th.Context, teamMember, s.th.SystemAdminUser.Id)
return s.th.App.RemoveUserFromTeam(s.th.Context, teamId, teamMember.UserId, s.th.SystemAdminUser.Id)
}

s.RunForSystemAdminAndLocal("Add user to team", func(c client.Client) {
Expand Down
2 changes: 1 addition & 1 deletion commands/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

var (
BuildHash = "dev mode"
Version = "6.0.0"
Version = "6.2.0"
)

var VersionCmd = &cobra.Command{
Expand Down
20 changes: 8 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,33 +1,29 @@
module github.com/mattermost/mmctl

go 1.13
go 1.16

require (
github.com/fatih/color v1.12.0
github.com/golang/mock v1.4.4
github.com/corpix/uarand v0.1.1 // indirect
github.com/fatih/color v1.13.0
github.com/golang/mock v1.6.0
github.com/gorilla/handlers v1.5.1
github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/memberlist v0.2.4
github.com/icrowley/fake v0.0.0-20180203215853-4178557ae428
github.com/isacikgoz/prompt v0.1.0
github.com/magefile/mage v1.11.0
github.com/magiconair/properties v1.8.4 // indirect
github.com/mattermost/gosaml2 v0.3.3
github.com/mattermost/ldap v0.0.0-20201202150706-ee0e6284187d
github.com/mattermost/mattermost-server/v6 v6.0.2
github.com/mattermost/mattermost-server/v6 v6.0.0-20211125163641-c62ea2860515
github.com/mattermost/rsc v0.0.0-20160330161541-bbaefb05eaa0
github.com/mitchellh/mapstructure v1.3.3 // indirect
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.11.0
github.com/sirupsen/logrus v1.8.1
github.com/spf13/afero v1.4.1 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/cobra v1.1.3
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/viper v1.7.0
github.com/spf13/cobra v1.2.1
github.com/spf13/viper v1.8.1
github.com/stretchr/testify v1.7.0
github.com/tylerb/graceful v1.2.15
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1
gopkg.in/olivere/elastic.v6 v6.2.35
gopkg.in/olivere/elastic.v6 v6.2.37
)
Loading

0 comments on commit 8ab71ce

Please sign in to comment.