Eliminate MM_SERVER_PATH (#24968)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
daf84488cc
Коммит
630bd40141
@@ -11,6 +11,7 @@ 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"
|
||||
|
||||
"github.com/mattermost/mattermost/server/public/model"
|
||||
"github.com/mattermost/mattermost/server/public/utils"
|
||||
@@ -19,9 +20,8 @@ import (
|
||||
|
||||
func (s *MmctlE2ETestSuite) TestExportListCmdF() {
|
||||
s.SetupTestHelper()
|
||||
serverPath := os.Getenv("MM_SERVER_PATH")
|
||||
importName := "import_test.zip"
|
||||
importFilePath := filepath.Join(serverPath, "tests", importName)
|
||||
importFilePath := filepath.Join(tests.GetPackagePath(), importName)
|
||||
exportPath, err := filepath.Abs(filepath.Join(*s.th.App.Config().FileSettings.Directory,
|
||||
*s.th.App.Config().ExportSettings.Directory))
|
||||
s.Require().Nil(err)
|
||||
@@ -72,9 +72,8 @@ func (s *MmctlE2ETestSuite) TestExportListCmdF() {
|
||||
|
||||
func (s *MmctlE2ETestSuite) TestExportDeleteCmdF() {
|
||||
s.SetupTestHelper()
|
||||
serverPath := os.Getenv("MM_SERVER_PATH")
|
||||
importName := "import_test.zip"
|
||||
importFilePath := filepath.Join(serverPath, "tests", importName)
|
||||
importFilePath := filepath.Join(tests.GetPackagePath(), importName)
|
||||
exportPath, err := filepath.Abs(filepath.Join(*s.th.App.Config().FileSettings.Directory,
|
||||
*s.th.App.Config().ExportSettings.Directory))
|
||||
s.Require().Nil(err)
|
||||
@@ -179,9 +178,8 @@ func (s *MmctlE2ETestSuite) TestExportCreateCmdF() {
|
||||
|
||||
func (s *MmctlE2ETestSuite) TestExportDownloadCmdF() {
|
||||
s.SetupTestHelper()
|
||||
serverPath := os.Getenv("MM_SERVER_PATH")
|
||||
importName := "import_test.zip"
|
||||
importFilePath := filepath.Join(serverPath, "tests", importName)
|
||||
importFilePath := filepath.Join(tests.GetPackagePath(), importName)
|
||||
exportPath, err := filepath.Abs(filepath.Join(*s.th.App.Config().FileSettings.Directory,
|
||||
*s.th.App.Config().ExportSettings.Directory))
|
||||
s.Require().Nil(err)
|
||||
|
||||
@@ -11,6 +11,7 @@ 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"
|
||||
|
||||
"github.com/mattermost/mattermost/server/public/model"
|
||||
"github.com/spf13/cobra"
|
||||
@@ -18,9 +19,8 @@ import (
|
||||
|
||||
func (s *MmctlE2ETestSuite) TestExtractRunCmdF() {
|
||||
s.SetupTestHelper().InitBasic()
|
||||
serverPath := os.Getenv("MM_SERVER_PATH")
|
||||
docName := "sample-doc.pdf"
|
||||
docFilePath := filepath.Join(serverPath, "tests", docName)
|
||||
docFilePath := filepath.Join(tests.GetPackagePath(), docName)
|
||||
|
||||
s.Run("no permissions", func() {
|
||||
printer.Clean()
|
||||
|
||||
@@ -11,6 +11,7 @@ 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"
|
||||
|
||||
"github.com/mattermost/mattermost/server/public/model"
|
||||
"github.com/spf13/cobra"
|
||||
@@ -18,9 +19,8 @@ import (
|
||||
|
||||
func (s *MmctlE2ETestSuite) TestImportUploadCmdF() {
|
||||
s.SetupTestHelper().InitBasic()
|
||||
serverPath := os.Getenv("MM_SERVER_PATH")
|
||||
importName := "import_test.zip"
|
||||
importFilePath := filepath.Join(serverPath, "tests", importName)
|
||||
importFilePath := filepath.Join(tests.GetPackagePath(), importName)
|
||||
info, err := os.Stat(importFilePath)
|
||||
s.Require().NoError(err)
|
||||
|
||||
@@ -91,9 +91,8 @@ func (s *MmctlE2ETestSuite) TestImportUploadCmdF() {
|
||||
|
||||
func (s *MmctlE2ETestSuite) TestImportProcessCmdF() {
|
||||
s.SetupTestHelper().InitBasic()
|
||||
serverPath := os.Getenv("MM_SERVER_PATH")
|
||||
importName := "import_test.zip"
|
||||
importFilePath := filepath.Join(serverPath, "tests", importName)
|
||||
importFilePath := filepath.Join(tests.GetPackagePath(), "import_test.zip")
|
||||
|
||||
s.Run("no permissions", func() {
|
||||
printer.Clean()
|
||||
@@ -131,9 +130,8 @@ func (s *MmctlE2ETestSuite) TestImportProcessCmdF() {
|
||||
|
||||
func (s *MmctlE2ETestSuite) TestImportListAvailableCmdF() {
|
||||
s.SetupTestHelper().InitBasic()
|
||||
serverPath := os.Getenv("MM_SERVER_PATH")
|
||||
importName := "import_test.zip"
|
||||
importFilePath := filepath.Join(serverPath, "tests", importName)
|
||||
importFilePath := filepath.Join(tests.GetPackagePath(), importName)
|
||||
|
||||
s.Run("no permissions", func() {
|
||||
printer.Clean()
|
||||
@@ -372,9 +370,8 @@ func (s *MmctlE2ETestSuite) TestImportJobListCmdF() {
|
||||
func (s *MmctlE2ETestSuite) TestImportValidateCmdF() {
|
||||
s.SetupTestHelper().InitBasic()
|
||||
|
||||
serverPath := os.Getenv("MM_SERVER_PATH")
|
||||
importName := "import_test.zip"
|
||||
importFilePath := filepath.Join(serverPath, "tests", importName)
|
||||
importFilePath := filepath.Join(tests.GetPackagePath(), importName)
|
||||
|
||||
s.RunForSystemAdminAndLocal("defaults", func(c client.Client) {
|
||||
printer.Clean()
|
||||
|
||||
@@ -5,7 +5,6 @@ package commands
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/hashicorp/go-multierror"
|
||||
"github.com/mattermost/mattermost/server/public/model"
|
||||
@@ -17,12 +16,13 @@ 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(os.Getenv("MM_SERVER_PATH"), "tests", "testplugin.tar.gz")
|
||||
pluginPath := filepath.Join(tests.GetPackagePath(), "testplugin.tar.gz")
|
||||
|
||||
s.RunForSystemAdminAndLocal("add an already installed plugin without force", func(c client.Client) {
|
||||
printer.Clean()
|
||||
|
||||
Ссылка в новой задаче
Block a user