summaryrefslogtreecommitdiffstats
path: root/cmd/mattermost/commands/server_test.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-05-18 08:37:43 -0700
committerGitHub <noreply@github.com>2018-05-18 08:37:43 -0700
commit0432f995ec27de9ee6cc2f5847d4a17fcc095a26 (patch)
treecc87cb698389d6191f6fc9d34fcacddb44850bb6 /cmd/mattermost/commands/server_test.go
parentd5e1f7e2982c2fcc888ccac550b34095efbee217 (diff)
downloadchat-0432f995ec27de9ee6cc2f5847d4a17fcc095a26.tar.gz
chat-0432f995ec27de9ee6cc2f5847d4a17fcc095a26.tar.bz2
chat-0432f995ec27de9ee6cc2f5847d4a17fcc095a26.zip
MM-9983 Requiring SiteURL to be set. (#8769)
* Requiring SiteURL to be set. * Modifying to make tests pass. * Fixing test.
Diffstat (limited to 'cmd/mattermost/commands/server_test.go')
-rw-r--r--cmd/mattermost/commands/server_test.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/cmd/mattermost/commands/server_test.go b/cmd/mattermost/commands/server_test.go
index 0f825e316..a0c7c6948 100644
--- a/cmd/mattermost/commands/server_test.go
+++ b/cmd/mattermost/commands/server_test.go
@@ -11,6 +11,7 @@ import (
"testing"
"github.com/mattermost/mattermost-server/jobs"
+ "github.com/mattermost/mattermost-server/model"
"github.com/mattermost/mattermost-server/utils"
"github.com/stretchr/testify/require"
)
@@ -20,6 +21,7 @@ type ServerTestHelper struct {
disableConfigWatch bool
interruptChan chan os.Signal
originalInterval int
+ oldBuildNumber string
}
func SetupServerTest() *ServerTestHelper {
@@ -41,14 +43,20 @@ func SetupServerTest() *ServerTestHelper {
interruptChan: interruptChan,
originalInterval: originalInterval,
}
+
+ // Run in dev mode so SiteURL gets set
+ th.oldBuildNumber = model.BuildNumber
+ model.BuildNumber = "dev"
+
return th
}
func (th *ServerTestHelper) TearDownServerTest() {
jobs.DEFAULT_WATCHER_POLLING_INTERVAL = th.originalInterval
+ model.BuildNumber = th.oldBuildNumber
}
-func TestRunServerSuccess(t *testing.T) {
+func TestRunServerSiteURL(t *testing.T) {
th := SetupServerTest()
defer th.TearDownServerTest()