Skip to content

Commit d3dbdbe

Browse files
zeripath6543
andauthored
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 <[email protected]> Co-authored-by: 6543 <[email protected]>
1 parent 42fe076 commit d3dbdbe

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

modules/indexer/stats/indexer_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212

1313
repo_model "code.gitea.io/gitea/models/repo"
1414
"code.gitea.io/gitea/models/unittest"
15+
"code.gitea.io/gitea/modules/git"
1516
"code.gitea.io/gitea/modules/queue"
1617
"code.gitea.io/gitea/modules/setting"
1718

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

2829
func TestRepoStatsIndex(t *testing.T) {
30+
if err := git.Init(context.Background()); !assert.NoError(t, err) {
31+
return
32+
}
33+
2934
assert.NoError(t, unittest.PrepareTestDatabase())
3035
setting.Cfg = ini.Empty()
3136

0 commit comments

Comments
 (0)