diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2025-01-02 04:36:50 +0100 |
---|---|---|
committer | Earl Warren <contact@earl-warren.org> | 2025-01-05 14:46:19 +0100 |
commit | e507fa30dfec8456159192c4d81667b4cb184988 (patch) | |
tree | 530621a4328ab17e3682f7f512c60a45bae06b7c /tests | |
parent | unset XDG_HOME_CONFIG as gitea manages configuration locations (#33067) (diff) | |
download | forgejo-e507fa30dfec8456159192c4d81667b4cb184988.tar.xz forgejo-e507fa30dfec8456159192c4d81667b4cb184988.zip |
Refactor env var related code (#33075)
And add more comments
(cherry picked from commit 4f386e2c5e39b860424faf4cbc02c16f641f956e)
Conflicts:
cmd/main_test.go
tests/integration/integration_test.go
trivial context conflicts
Diffstat (limited to 'tests')
-rw-r--r-- | tests/e2e/e2e_test.go | 7 | ||||
-rw-r--r-- | tests/integration/integration_test.go | 12 |
2 files changed, 0 insertions, 19 deletions
diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index b8c89625c0..88b254b6f9 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -40,13 +40,6 @@ func TestMain(m *testing.M) { initChangedFiles() testE2eWebRoutes = routers.NormalRoutes() - os.Unsetenv("GIT_AUTHOR_NAME") - os.Unsetenv("GIT_AUTHOR_EMAIL") - os.Unsetenv("GIT_AUTHOR_DATE") - os.Unsetenv("GIT_COMMITTER_NAME") - os.Unsetenv("GIT_COMMITTER_EMAIL") - os.Unsetenv("GIT_COMMITTER_DATE") - err := unittest.InitFixtures( unittest.FixturesOptions{ Dir: filepath.Join(setting.AppWorkPath, "models/fixtures/"), diff --git a/tests/integration/integration_test.go b/tests/integration/integration_test.go index 65b715a688..06d2586d1c 100644 --- a/tests/integration/integration_test.go +++ b/tests/integration/integration_test.go @@ -159,18 +159,6 @@ func TestMain(m *testing.M) { } } - os.Unsetenv("GIT_AUTHOR_NAME") - os.Unsetenv("GIT_AUTHOR_EMAIL") - os.Unsetenv("GIT_AUTHOR_DATE") - os.Unsetenv("GIT_COMMITTER_NAME") - os.Unsetenv("GIT_COMMITTER_EMAIL") - os.Unsetenv("GIT_COMMITTER_DATE") - - // Avoid loading the default system config. On MacOS, this config - // sets the osxkeychain credential helper, which will cause tests - // to freeze with a dialog. - os.Setenv("GIT_CONFIG_NOSYSTEM", "true") - err := unittest.InitFixtures( unittest.FixturesOptions{ Dir: filepath.Join(filepath.Dir(setting.AppPath), "models/fixtures/"), |