Skip to content

Commit

Permalink
Unset git author/committer variables when running integration tests (g…
Browse files Browse the repository at this point in the history
…o-gitea#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 go-gitea#14247

Signed-off-by: Andrew Thornton <[email protected]>
  • Loading branch information
zeripath authored and AbdulrhmnGhanem committed Aug 23, 2022
1 parent 4b87f67 commit 2d7e45b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions integrations/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/"),
Expand Down

0 comments on commit 2d7e45b

Please sign in to comment.