This commit is contained in:
wxiaoguang
2026-04-25 19:59:18 +08:00
parent 81fcfab0e3
commit 0b7aee8147
2 changed files with 2 additions and 6 deletions

View File

@@ -2,7 +2,7 @@
// SPDX-License-Identifier: MIT
// Tests here reload the config system multiple times with uncontrollable details.
// So it must be in a separate package, to avoid affecting other tests
// So they must be in a separate package, to avoid affecting other tests
package cmdtest

View File

@@ -12,7 +12,6 @@ import (
"code.gitea.io/gitea/modules/auth/password/hash"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/util"
)
var giteaTestSourceRoot *string
@@ -51,10 +50,7 @@ func SetupGiteaTestEnv() {
}
initGiteaPaths := func() {
appWorkPathBuiltin = *giteaTestSourceRoot
AppWorkPath = appWorkPathBuiltin
AppPath = filepath.Join(AppWorkPath, "gitea") + util.Iif(IsWindows, ".exe", "")
StaticRootPath = AppWorkPath // need to load assets (options, public) from the source code directory for testing
StaticRootPath = *giteaTestSourceRoot // need to load assets (options, public) from the source code directory for testing
}
initGiteaConf := func() string {