Skip to content

Commit c1343a1

Browse files
committed
Prevent intermittent failures in RepoIndexerTest (2)
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 <[email protected]>
1 parent 41b60d9 commit c1343a1

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)