Prevent intermittent failures in RepoIndexerTest (2) (#19229)

So whilst #19225 fixes one issue it caused another. We need to initialise the Git
module first.

Related #19225
Fix #19162

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: 6543 <6543@obermui.de>
pull/18930/head
zeripath 3 years ago committed by GitHub
parent 42fe076084
commit d3dbdbe6c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      modules/indexer/stats/indexer_test.go

@ -12,6 +12,7 @@ import (
repo_model "code.gitea.io/gitea/models/repo" repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/models/unittest" "code.gitea.io/gitea/models/unittest"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/queue" "code.gitea.io/gitea/modules/queue"
"code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/setting"
@ -26,6 +27,10 @@ func TestMain(m *testing.M) {
} }
func TestRepoStatsIndex(t *testing.T) { func TestRepoStatsIndex(t *testing.T) {
if err := git.Init(context.Background()); !assert.NoError(t, err) {
return
}
assert.NoError(t, unittest.PrepareTestDatabase()) assert.NoError(t, unittest.PrepareTestDatabase())
setting.Cfg = ini.Empty() setting.Cfg = ini.Empty()

Loading…
Cancel
Save