Skip to content

Commit

Permalink
Prevent intermittent failures in RepoIndexerTest (2)
Browse files Browse the repository at this point in the history
So whilst go-gitea#19225 fixes one issue it caused another. We need to initialise the Git
module first.

Related go-gitea#19225
Fix go-gitea#19162

Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath committed Mar 27, 2022
1 parent 41b60d9 commit c1343a1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/indexer/stats/indexer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/models/unittest"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/queue"
"code.gitea.io/gitea/modules/setting"

Expand All @@ -26,6 +27,10 @@ func TestMain(m *testing.M) {
}

func TestRepoStatsIndex(t *testing.T) {
if err := git.Init(context.Background()); !assert.NoError(t, err) {
return
}

assert.NoError(t, unittest.PrepareTestDatabase())
setting.Cfg = ini.Empty()

Expand Down

0 comments on commit c1343a1

Please sign in to comment.