Skip to content

Commit 5d34f06

Browse files
committed
fix tests
1 parent 954cba9 commit 5d34f06

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

integrations/repo_search_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111

1212
"code.gitea.io/gitea/models"
1313
"code.gitea.io/gitea/modules/setting"
14+
code_indexer "code.gitea.io/gitea/modules/indexer/code"
1415

1516
"github.com/PuerkitoBio/goquery"
1617
"github.com/stretchr/testify/assert"
@@ -34,7 +35,7 @@ func TestSearchRepo(t *testing.T) {
3435
repo, err := models.GetRepositoryByOwnerAndName("user2", "repo1")
3536
assert.NoError(t, err)
3637

37-
executeIndexer(t, repo, models.UpdateRepoIndexer)
38+
executeIndexer(t, repo, code_indexer.UpdateRepoIndexer)
3839

3940
testSearch(t, "/user2/repo1/search?q=Description&page=1", []string{"README.md"})
4041

@@ -44,8 +45,8 @@ func TestSearchRepo(t *testing.T) {
4445
repo, err = models.GetRepositoryByOwnerAndName("user2", "glob")
4546
assert.NoError(t, err)
4647

47-
executeIndexer(t, repo, models.DeleteRepoFromIndexer)
48-
executeIndexer(t, repo, models.UpdateRepoIndexer)
48+
executeIndexer(t, repo, code_indexer.DeleteRepoFromIndexer)
49+
executeIndexer(t, repo, code_indexer.UpdateRepoIndexer)
4950

5051
testSearch(t, "/user2/glob/search?q=loren&page=1", []string{"a.txt"})
5152
testSearch(t, "/user2/glob/search?q=file3&page=1", []string{"x/b.txt"})

modules/indexer/code/bleve_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,14 @@
33
// license that can be found in the LICENSE file.
44

55
package code
6+
7+
import (
8+
"path/filepath"
9+
"testing"
10+
11+
"code.gitea.io/gitea/models"
12+
)
13+
14+
func TestMain(m *testing.M) {
15+
models.MainTest(m, filepath.Join("..", "..", ".."))
16+
}

0 commit comments

Comments
 (0)