Этот коммит содержится в:
Jesse Hallam
2024-05-10 18:13:05 -03:00
коммит произвёл GitHub
родитель daf84488cc
Коммит 630bd40141
17 изменённых файлов: 95 добавлений и 91 удалений

Просмотреть файл

@@ -14,6 +14,7 @@ import (
"github.com/mattermost/mattermost/server/public/model"
"github.com/mattermost/mattermost/server/public/utils"
"github.com/mattermost/mattermost/server/v8/channels/testlib/testdata"
"github.com/mattermost/mattermost/server/v8/channels/utils/fileutils"
"github.com/mattermost/mattermost/server/v8/platform/shared/filestore"
)
@@ -38,7 +39,11 @@ type testResourceDetails struct {
}
func findFile(path string) string {
return fileutils.FindPath(path, fileutils.CommonBaseSearchPaths(), func(fileInfo os.FileInfo) bool {
// Use the testdata path to search from the root of the monorepo.
searchPaths := fileutils.CommonBaseSearchPaths()
searchPaths = append(searchPaths, filepath.Join(testdata.GetPackagePath(), "../../../"))
return fileutils.FindPath(path, searchPaths, func(fileInfo os.FileInfo) bool {
return !fileInfo.IsDir()
})
}
@@ -53,7 +58,11 @@ func findDir(dir string) (string, bool) {
return path.Dir(srcPath), true
}
found := fileutils.FindPath(dir, fileutils.CommonBaseSearchPaths(), func(fileInfo os.FileInfo) bool {
// Use the testdata path to search from the root of the monorepo.
searchPaths := fileutils.CommonBaseSearchPaths()
searchPaths = append(searchPaths, filepath.Join(testdata.GetPackagePath(), "../../../"))
found := fileutils.FindPath(dir, searchPaths, func(fileInfo os.FileInfo) bool {
return fileInfo.IsDir()
})
if found == "" {