From 5204ef97d3c5523c18707e11e65099d4e348a0b2 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Sat, 25 Apr 2026 16:11:02 +0800 Subject: [PATCH] fine tune --- cmd/cmdtest/cmd_test.go | 2 +- models/unittest/testdb.go | 2 +- modules/setting/testenv.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/cmdtest/cmd_test.go b/cmd/cmdtest/cmd_test.go index 1de9390ec84..3473013fd27 100644 --- a/cmd/cmdtest/cmd_test.go +++ b/cmd/cmdtest/cmd_test.go @@ -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 diff --git a/models/unittest/testdb.go b/models/unittest/testdb.go index e5c91fdff3b..c1286d1f349 100644 --- a/models/unittest/testdb.go +++ b/models/unittest/testdb.go @@ -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 == "" { diff --git a/modules/setting/testenv.go b/modules/setting/testenv.go index 30ea1bb98ab..c10dc06aa1f 100644 --- a/modules/setting/testenv.go +++ b/modules/setting/testenv.go @@ -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)