Update testlibrary helper.go to reflect Monorepo (#23848)

This commit is contained in:
Sinan Sonmez (Chaush)
2023-06-29 11:32:25 +03:00
committed by GitHub
parent c6916c7047
commit 385bf19972
+12 -2
View File
@@ -171,7 +171,12 @@ func (h *MainHelper) PreloadMigrations() {
basePath := os.Getenv("MM_SERVER_PATH")
if basePath == "" {
basePath = "mattermost-server/server"
_, errFile := os.Stat("mattermost-server/server")
if os.IsNotExist(errFile) {
basePath = "mattermost/server"
} else {
basePath = "mattermost-server/server"
}
}
relPath := "channels/testlib/testdata"
switch *h.Settings.DriverName {
@@ -213,7 +218,12 @@ func (h *MainHelper) PreloadBoardsMigrationsIfNeeded() {
basePath := os.Getenv("MM_SERVER_PATH")
if basePath == "" {
basePath = "mattermost-server/server"
_, errFile := os.Stat("mattermost-server/server")
if os.IsNotExist(errFile) {
basePath = "mattermost/server"
} else {
basePath = "mattermost-server/server"
}
}
relPath := "channels/testlib/testdata"