MM-43753: Module workspaces (#20113)
* MM-43753: Module workspaces Move to module workspaces We make the following changes: - Remove the vendor directory. - Dynamically create the go.work file if it doesn't exist. - Set the MM_SERVER_PATH for enterprise tests. https://mattermost.atlassian.net/browse/MM-43753 ```release-note NONE ``` * Fix missing reference to MM_SERVER_PATH ```release-note NONE ``` * Update test to add another nested dir ```release-note NONE ``` * Have separate script to create go.work file ```release-note NONE ``` Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
cd487c812c
Коммит
38d0c2bcf3
@@ -38,26 +38,8 @@ type testResourceDetails struct {
|
||||
action int8
|
||||
}
|
||||
|
||||
// getCommonBaseSearchPaths() is a custom version of what fileutils exposes. At some point, consolidate.
|
||||
func getCommonBaseSearchPaths() []string {
|
||||
paths := []string{
|
||||
".",
|
||||
"..",
|
||||
"../..",
|
||||
"../../..",
|
||||
"../../../..",
|
||||
}
|
||||
|
||||
// this enables the server to be used in tests from a different repository
|
||||
if mmPath := os.Getenv("MM_SERVER_PATH"); mmPath != "" {
|
||||
paths = append(paths, mmPath)
|
||||
}
|
||||
|
||||
return paths
|
||||
}
|
||||
|
||||
func findFile(path string) string {
|
||||
return fileutils.FindPath(path, getCommonBaseSearchPaths(), func(fileInfo os.FileInfo) bool {
|
||||
return fileutils.FindPath(path, fileutils.CommonBaseSearchPaths(), func(fileInfo os.FileInfo) bool {
|
||||
return !fileInfo.IsDir()
|
||||
})
|
||||
}
|
||||
@@ -72,7 +54,7 @@ func findDir(dir string) (string, bool) {
|
||||
return path.Dir(srcPath), true
|
||||
}
|
||||
|
||||
found := fileutils.FindPath(dir, getCommonBaseSearchPaths(), func(fileInfo os.FileInfo) bool {
|
||||
found := fileutils.FindPath(dir, fileutils.CommonBaseSearchPaths(), func(fileInfo os.FileInfo) bool {
|
||||
return fileInfo.IsDir()
|
||||
})
|
||||
if found == "" {
|
||||
|
||||
Ссылка в новой задаче
Block a user