https://mattermost.atlassian.net/browse/MM-52079 ```release-note We upgrade the module version to 8.0. The new module path is github.com/mattermost-server/server/v8. ``` Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
41 строка
989 B
Go
41 строка
989 B
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package app
|
|
|
|
import (
|
|
"reflect"
|
|
"runtime"
|
|
"testing"
|
|
|
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
|
)
|
|
|
|
func TestGetServerMetadata(t *testing.T) {
|
|
th, tearDown := SetupTestHelper(t)
|
|
defer tearDown()
|
|
|
|
th.Store.EXPECT().DBType().Return("TEST_DB_TYPE")
|
|
th.Store.EXPECT().DBVersion().Return("TEST_DB_VERSION")
|
|
|
|
t.Run("Get Server Metadata", func(t *testing.T) {
|
|
got := th.App.GetServerMetadata()
|
|
want := &ServerMetadata{
|
|
Version: model.CurrentVersion,
|
|
BuildNumber: model.BuildNumber,
|
|
BuildDate: model.BuildDate,
|
|
Commit: model.BuildHash,
|
|
Edition: model.Edition,
|
|
DBType: "TEST_DB_TYPE",
|
|
DBVersion: "TEST_DB_VERSION",
|
|
OSType: runtime.GOOS,
|
|
OSArch: runtime.GOARCH,
|
|
SKU: "personal_server",
|
|
}
|
|
|
|
if !reflect.DeepEqual(got, want) {
|
|
t.Errorf("got: %q, want: %q", got, want)
|
|
}
|
|
})
|
|
}
|