Skip to content

Commit f8a7ec2

Browse files
committed
test
1 parent 4af4900 commit f8a7ec2

File tree

4 files changed

+31
-8
lines changed

4 files changed

+31
-8
lines changed

custom/conf/app.example.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,7 +1309,6 @@ LEVEL = Info
13091309
;; All available reactions users can choose on issues/prs and comments.
13101310
;; Values can be emoji alias (:smile:) or a unicode emoji.
13111311
;; For custom reactions, add a tightly cropped square image to public/assets/img/emoji/reaction_name.png
1312-
;; Deprecated in v1.24
13131312
;REACTIONS = +1, -1, laugh, hooray, confused, heart, rocket, eyes
13141313
;;
13151314
;; Change the number of users that are displayed in reactions tooltip (triggered by mouse hover).
@@ -1319,7 +1318,6 @@ LEVEL = Info
13191318
;; Additional Emojis not defined in the utf8 standard
13201319
;; By default we support gitea (:gitea:), to add more copy them to public/assets/img/emoji/emoji_name.png and add it to this config.
13211320
;; Dont mistake it for Reactions.
1322-
;; Deprecated in v1.24
13231321
;CUSTOM_EMOJIS = gitea, codeberg, gitlab, git, github, gogs
13241322
;;
13251323
;; Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# type Setting struct {
2+
# ID int64 `xorm:"pk autoincr"`
3+
# SettingKey string `xorm:"varchar(255) unique"` // key should be lowercase
4+
# SettingValue string `xorm:"text"`
5+
# Version int `xorm:"version"`
6+
# Created timeutil.TimeStamp `xorm:"created"`
7+
# Updated timeutil.TimeStamp `xorm:"updated"`
8+
# }
9+
-
10+
id: 1
11+
setting_key: revision
12+
version: 1
13+
14+
-
15+
id: 2
16+
setting_key: picture.enable_federated_avatar
17+
setting_value: false
18+
version: 1
19+
20+
-
21+
id: 3
22+
setting_key: picture.disable_gravatar
23+
setting_value: true
24+
version: 1

models/migrations/v1_24/v315_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@ package v1_24 //nolint
66
import (
77
"testing"
88

9-
"code.gitea.io/gitea/models/db"
10-
"code.gitea.io/gitea/models/unittest"
9+
"code.gitea.io/gitea/models/migrations/base"
1110

1211
"github.com/stretchr/testify/assert"
1312
)
1413

1514
func Test_MigrateIniToDatabase(t *testing.T) {
16-
if err := db.InitEngine(t.Context()); err != nil {
17-
t.Fatal(err)
15+
// Prepare and load the testing database
16+
x, deferable := base.PrepareTestEnv(t, 0, new(Setting))
17+
defer deferable()
18+
if x == nil || t.Failed() {
19+
return
1820
}
19-
x := unittest.GetXORMEngine()
2021

2122
assert.NoError(t, MigrateIniToDatabase(x))
2223

modules/setting/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ func initDefaultConfig() {
160160
UI: &UIStruct{
161161
ExplorePagingNum: config.ValueJSON[int]("ui.explore_paging_num").WithFileConfig(config.CfgSecKey{Sec: "ui", Key: "EXPLORE_PAGING_NUM"}).WithDefault(20),
162162
SitemapPagingNum: config.ValueJSON[int]("ui.sitemap_paging_num").WithFileConfig(config.CfgSecKey{Sec: "ui", Key: "SITEMAP_PAGING_NUM"}).WithDefault(20),
163-
IssuePagingNum: config.ValueJSON[int]("ui.issue_paging_num").WithFileConfig(config.CfgSecKey{Sec: "ui", Key: "ISSUE_PAGING_NUM"}).WithDefault(5),
163+
IssuePagingNum: config.ValueJSON[int]("ui.issue_paging_num").WithFileConfig(config.CfgSecKey{Sec: "ui", Key: "ISSUE_PAGING_NUM"}).WithDefault(20),
164164
RepoSearchPagingNum: config.ValueJSON[int]("ui.repo_search_paging_num").WithFileConfig(config.CfgSecKey{Sec: "ui", Key: "REPO_SEARCH_PAGING_NUM"}).WithDefault(20),
165165
MembersPagingNum: config.ValueJSON[int]("ui.members_paging_num").WithFileConfig(config.CfgSecKey{Sec: "ui", Key: "MEMBERS_PAGING_NUM"}).WithDefault(20),
166166
FeedMaxCommitNum: config.ValueJSON[int]("ui.feed_max_commit_num").WithFileConfig(config.CfgSecKey{Sec: "ui", Key: "FEED_MAX_COMMIT_NUM"}).WithDefault(20),

0 commit comments

Comments
 (0)