fine tune

This commit is contained in:
wxiaoguang
2026-04-25 16:11:02 +08:00
parent 3359227aec
commit 5204ef97d3
3 changed files with 3 additions and 3 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 affect other tests
// So it must be in a separate package, to avoid affecting other tests
package cmdtest

View File

@@ -50,7 +50,7 @@ func mainTest(m *testing.M, testOptsArg ...*TestOptions) int {
defer appDataCleanup()
_ = os.Setenv("GITEA_TEST_CONF_CONTENT", `
[server]
APP_DATA_PATH = "`+appDataPath+`"
APP_DATA_PATH = `+appDataPath+`
`)
setting.SetupGiteaTestEnv()
if setting.RepoRootPath == "" || setting.AppDataPath == "" {

View File

@@ -65,7 +65,7 @@ func SetupGiteaTestEnv() {
giteaConf = "custom/conf/app-test-tmp.ini"
customConfBuiltin = filepath.Join(AppWorkPath, giteaConf)
CustomConf = customConfBuiltin
_ = os.WriteFile(CustomConf, []byte(os.Getenv("GITEA_TEST_CONF_CONTENT")), os.ModePerm)
_ = os.WriteFile(CustomConf, []byte(os.Getenv("GITEA_TEST_CONF_CONTENT")), 0o644)
} else {
// CustomConf must be absolute path to make tests pass,
CustomConf = filepath.Join(AppWorkPath, giteaConf)