aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2022-03-27 22:54:51 +0100
committerGitHub <noreply@github.com>2022-03-27 17:54:51 -0400
commitd3dbdbe6c5abbc0d3a6a342f3a29d3895fad1270 (patch)
tree52ba2fcb53b3e39d7f4467edbecc70c0f347dbd1
parent42fe076084d37e5ede7166c136f1dda47bcf40f5 (diff)
downloadgitea-d3dbdbe6c5abbc0d3a6a342f3a29d3895fad1270.tar.gz
gitea-d3dbdbe6c5abbc0d3a6a342f3a29d3895fad1270.zip
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>
-rw-r--r--modules/indexer/stats/indexer_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/indexer/stats/indexer_test.go b/modules/indexer/stats/indexer_test.go
index 03b5e61fdc..b5c58ab25a 100644
--- a/modules/indexer/stats/indexer_test.go
+++ b/modules/indexer/stats/indexer_test.go
@@ -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"
@@ -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()