@@ -26,6 +26,7 @@ import (
2626 "time"
2727
2828 "code.gitea.io/gitea/models"
29+ "code.gitea.io/gitea/models/db"
2930 gitea_git "code.gitea.io/gitea/modules/git"
3031 "code.gitea.io/gitea/modules/markup"
3132 "code.gitea.io/gitea/modules/markup/external"
@@ -87,27 +88,27 @@ func runPR() {
8788 setting.Database.Path = ":memory:"
8889 setting.Database.Timeout = 500
8990 */
90- db := setting .Cfg .Section ("database" )
91- db .NewKey ("DB_TYPE" , "sqlite3" )
92- db .NewKey ("PATH" , ":memory:" )
91+ dbCfg := setting .Cfg .Section ("database" )
92+ dbCfg .NewKey ("DB_TYPE" , "sqlite3" )
93+ dbCfg .NewKey ("PATH" , ":memory:" )
9394
9495 routers .NewServices ()
9596 setting .Database .LogSQL = true
9697 //x, err = xorm.NewEngine("sqlite3", "file::memory:?cache=shared")
9798
98- models .NewEngine (context .Background (), func (_ * xorm.Engine ) error {
99+ db .NewEngine (context .Background (), func (_ * xorm.Engine ) error {
99100 return nil
100101 })
101- models .HasEngine = true
102+ db .HasEngine = true
102103 //x.ShowSQL(true)
103- err = models .InitFixtures (
104+ err = db .InitFixtures (
104105 path .Join (curDir , "models/fixtures/" ),
105106 )
106107 if err != nil {
107108 fmt .Printf ("Error initializing test database: %v\n " , err )
108109 os .Exit (1 )
109110 }
110- models .LoadFixtures ()
111+ db .LoadFixtures ()
111112 util .RemoveAll (setting .RepoRootPath )
112113 util .RemoveAll (models .LocalCopyPath ())
113114 util .CopyDir (path .Join (curDir , "integrations/gitea-repositories-meta" ), setting .RepoRootPath )
0 commit comments