Этот коммит содержится в:
Jesse Hallam
2024-05-15 12:05:13 -03:00
коммит произвёл GitHub
родитель e96db725ea
Коммит cd51dec6e5
12 изменённых файлов: 36 добавлений и 71 удалений

Просмотреть файл

@@ -9,9 +9,9 @@ import (
"path/filepath"
"time"
"github.com/mattermost/mattermost/server/v8"
"github.com/mattermost/mattermost/server/v8/cmd/mmctl/client"
"github.com/mattermost/mattermost/server/v8/cmd/mmctl/printer"
"github.com/mattermost/mattermost/server/v8/tests"
"github.com/mattermost/mattermost/server/public/model"
"github.com/mattermost/mattermost/server/public/utils"
@@ -21,7 +21,7 @@ import (
func (s *MmctlE2ETestSuite) TestExportListCmdF() {
s.SetupTestHelper()
importName := "import_test.zip"
importFilePath := filepath.Join(tests.GetPackagePath(), importName)
importFilePath := filepath.Join(server.GetPackagePath(), "tests", importName)
exportPath, err := filepath.Abs(filepath.Join(*s.th.App.Config().FileSettings.Directory,
*s.th.App.Config().ExportSettings.Directory))
s.Require().Nil(err)
@@ -73,7 +73,7 @@ func (s *MmctlE2ETestSuite) TestExportListCmdF() {
func (s *MmctlE2ETestSuite) TestExportDeleteCmdF() {
s.SetupTestHelper()
importName := "import_test.zip"
importFilePath := filepath.Join(tests.GetPackagePath(), importName)
importFilePath := filepath.Join(server.GetPackagePath(), "tests", importName)
exportPath, err := filepath.Abs(filepath.Join(*s.th.App.Config().FileSettings.Directory,
*s.th.App.Config().ExportSettings.Directory))
s.Require().Nil(err)
@@ -179,7 +179,7 @@ func (s *MmctlE2ETestSuite) TestExportCreateCmdF() {
func (s *MmctlE2ETestSuite) TestExportDownloadCmdF() {
s.SetupTestHelper()
importName := "import_test.zip"
importFilePath := filepath.Join(tests.GetPackagePath(), importName)
importFilePath := filepath.Join(server.GetPackagePath(), "tests", importName)
exportPath, err := filepath.Abs(filepath.Join(*s.th.App.Config().FileSettings.Directory,
*s.th.App.Config().ExportSettings.Directory))
s.Require().Nil(err)

Просмотреть файл

@@ -9,9 +9,9 @@ import (
"path/filepath"
"time"
"github.com/mattermost/mattermost/server/v8"
"github.com/mattermost/mattermost/server/v8/cmd/mmctl/client"
"github.com/mattermost/mattermost/server/v8/cmd/mmctl/printer"
"github.com/mattermost/mattermost/server/v8/tests"
"github.com/mattermost/mattermost/server/public/model"
"github.com/spf13/cobra"
@@ -20,7 +20,7 @@ import (
func (s *MmctlE2ETestSuite) TestExtractRunCmdF() {
s.SetupTestHelper().InitBasic()
docName := "sample-doc.pdf"
docFilePath := filepath.Join(tests.GetPackagePath(), docName)
docFilePath := filepath.Join(server.GetPackagePath(), "tests", docName)
s.Run("no permissions", func() {
printer.Clean()

Просмотреть файл

@@ -9,9 +9,9 @@ import (
"path/filepath"
"time"
"github.com/mattermost/mattermost/server/v8"
"github.com/mattermost/mattermost/server/v8/cmd/mmctl/client"
"github.com/mattermost/mattermost/server/v8/cmd/mmctl/printer"
"github.com/mattermost/mattermost/server/v8/tests"
"github.com/mattermost/mattermost/server/public/model"
"github.com/spf13/cobra"
@@ -20,7 +20,7 @@ import (
func (s *MmctlE2ETestSuite) TestImportUploadCmdF() {
s.SetupTestHelper().InitBasic()
importName := "import_test.zip"
importFilePath := filepath.Join(tests.GetPackagePath(), importName)
importFilePath := filepath.Join(server.GetPackagePath(), "tests", importName)
info, err := os.Stat(importFilePath)
s.Require().NoError(err)
@@ -92,7 +92,7 @@ func (s *MmctlE2ETestSuite) TestImportUploadCmdF() {
func (s *MmctlE2ETestSuite) TestImportProcessCmdF() {
s.SetupTestHelper().InitBasic()
importName := "import_test.zip"
importFilePath := filepath.Join(tests.GetPackagePath(), "import_test.zip")
importFilePath := filepath.Join(server.GetPackagePath(), "tests", "import_test.zip")
s.Run("no permissions", func() {
printer.Clean()
@@ -131,7 +131,7 @@ func (s *MmctlE2ETestSuite) TestImportProcessCmdF() {
func (s *MmctlE2ETestSuite) TestImportListAvailableCmdF() {
s.SetupTestHelper().InitBasic()
importName := "import_test.zip"
importFilePath := filepath.Join(tests.GetPackagePath(), importName)
importFilePath := filepath.Join(server.GetPackagePath(), "tests", importName)
s.Run("no permissions", func() {
printer.Clean()
@@ -371,7 +371,7 @@ func (s *MmctlE2ETestSuite) TestImportValidateCmdF() {
s.SetupTestHelper().InitBasic()
importName := "import_test.zip"
importFilePath := filepath.Join(tests.GetPackagePath(), importName)
importFilePath := filepath.Join(server.GetPackagePath(), "tests", importName)
s.RunForSystemAdminAndLocal("defaults", func(c client.Client) {
printer.Clean()

Просмотреть файл

@@ -8,6 +8,7 @@ import (
"github.com/hashicorp/go-multierror"
"github.com/mattermost/mattermost/server/public/model"
"github.com/mattermost/mattermost/server/v8"
"github.com/pkg/errors"
"path/filepath"
@@ -16,13 +17,12 @@ import (
"github.com/mattermost/mattermost/server/v8/cmd/mmctl/client"
"github.com/mattermost/mattermost/server/v8/cmd/mmctl/printer"
"github.com/mattermost/mattermost/server/v8/tests"
)
func (s *MmctlE2ETestSuite) TestPluginAddCmd() {
s.SetupTestHelper().InitBasic()
pluginPath := filepath.Join(tests.GetPackagePath(), "testplugin.tar.gz")
pluginPath := filepath.Join(server.GetPackagePath(), "tests", "testplugin.tar.gz")
s.RunForSystemAdminAndLocal("add an already installed plugin without force", func(c client.Client) {
printer.Clean()