MM-13893: refactor config (#10230)
* refactor utils/config* to config/ * pull validateLdapFilter into app * clean up Config/GetConfig/GetSanitizedConfig usage Eliminate app.GetConfig() in favour of just using app.Config() directly, but expose app.GetSanitizedConfig() for when the old behaviour was required. * web: isolate config setup * TestInvitePeopleProvider: make config explicit * regenerateClientConfig: avoid racey map access * integrate watch flag into app.ConfigFile option * make app.Option return an error * release.mk: only cp static files from config/ * release.mk: fix cp static files from config/ * api4: TestPlugin cleanup * s/c/cfg/ for clarity * fix merge conflict * testlib: allow customization of testlib driver name
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
aca8914e35
Коммит
3a71709103
@@ -12,6 +12,7 @@ import (
|
||||
"net/mail"
|
||||
"net/smtp"
|
||||
|
||||
"github.com/mattermost/mattermost-server/config"
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/services/filesstore"
|
||||
"github.com/mattermost/mattermost-server/utils"
|
||||
@@ -20,7 +21,7 @@ import (
|
||||
)
|
||||
|
||||
func TestMailConnectionFromConfig(t *testing.T) {
|
||||
cfg, _, _, err := utils.LoadConfig("config.json")
|
||||
cfg, _, _, err := config.LoadConfig("config.json")
|
||||
require.Nil(t, err)
|
||||
|
||||
if conn, err := ConnectToSMTPServer(cfg); err != nil {
|
||||
@@ -43,7 +44,7 @@ func TestMailConnectionFromConfig(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMailConnectionAdvanced(t *testing.T) {
|
||||
cfg, _, _, err := utils.LoadConfig("config.json")
|
||||
cfg, _, _, err := config.LoadConfig("config.json")
|
||||
require.Nil(t, err)
|
||||
|
||||
if conn, err := ConnectToSMTPServerAdvanced(
|
||||
@@ -93,7 +94,7 @@ func TestMailConnectionAdvanced(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSendMailUsingConfig(t *testing.T) {
|
||||
cfg, _, _, err := utils.LoadConfig("config.json")
|
||||
cfg, _, _, err := config.LoadConfig("config.json")
|
||||
require.Nil(t, err)
|
||||
utils.T = utils.GetUserTranslations("en")
|
||||
|
||||
@@ -135,7 +136,7 @@ func TestSendMailUsingConfig(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSendMailUsingConfigAdvanced(t *testing.T) {
|
||||
cfg, _, _, err := utils.LoadConfig("config.json")
|
||||
cfg, _, _, err := config.LoadConfig("config.json")
|
||||
require.Nil(t, err)
|
||||
utils.T = utils.GetUserTranslations("en")
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user