summaryrefslogtreecommitdiffstats
path: root/integrations
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2022-04-26 21:28:45 +0100
committerGitHub <noreply@github.com>2022-04-26 16:28:45 -0400
commit6dd36379f24142198671e7c3f0ae44c3f579d21d (patch)
tree0fe53975844c2703c19eb4beabd2ee2f96aa5f1f /integrations
parent2347c9ebbe1cf180cfa714ea0118b79df1ced2cd (diff)
downloadgitea-6dd36379f24142198671e7c3f0ae44c3f579d21d.tar.gz
gitea-6dd36379f24142198671e7c3f0ae44c3f579d21d.zip
Unset git author/committer variables when running integration tests (#19512)
TestAPIGitTag (and likely others) will fail if the running environment contains GIT_AUTHOR_NAME and other env variables like it. This PR simply unsets these when running the integration tests. Fix #14247 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'integrations')
-rw-r--r--integrations/integration_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/integrations/integration_test.go b/integrations/integration_test.go
index 8d2bfe9383..228b412372 100644
--- a/integrations/integration_test.go
+++ b/integrations/integration_test.go
@@ -112,6 +112,13 @@ 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")
+
err := unittest.InitFixtures(
unittest.FixturesOptions{
Dir: filepath.Join(filepath.Dir(setting.AppPath), "models/fixtures/"),