diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2021-11-12 22:36:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-12 22:36:47 +0800 |
commit | df64fa486555de6f403a795fd16c2e9e1d59e535 (patch) | |
tree | b899e9b9e5d57409b1bf0e3afbd606b6a3900235 /contrib/pr | |
parent | 7f802631c54d2e91301158380b273b872d62bd80 (diff) | |
download | gitea-df64fa486555de6f403a795fd16c2e9e1d59e535.tar.gz gitea-df64fa486555de6f403a795fd16c2e9e1d59e535.zip |
Decouple unit test code from business code (#17623)
Diffstat (limited to 'contrib/pr')
-rw-r--r-- | contrib/pr/checkout.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/pr/checkout.go b/contrib/pr/checkout.go index 89d92c8526..1e2a9714e3 100644 --- a/contrib/pr/checkout.go +++ b/contrib/pr/checkout.go @@ -26,6 +26,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/models/db" + "code.gitea.io/gitea/models/unittest" gitea_git "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/markup" "code.gitea.io/gitea/modules/markup/external" @@ -99,8 +100,8 @@ func runPR() { }) db.HasEngine = true //x.ShowSQL(true) - err = db.InitFixtures( - db.FixturesOptions{ + err = unittest.InitFixtures( + unittest.FixturesOptions{ Dir: path.Join(curDir, "models/fixtures/"), }, ) @@ -108,7 +109,7 @@ func runPR() { fmt.Printf("Error initializing test database: %v\n", err) os.Exit(1) } - db.LoadFixtures() + unittest.LoadFixtures() util.RemoveAll(setting.RepoRootPath) util.RemoveAll(models.LocalCopyPath()) util.CopyDir(path.Join(curDir, "integrations/gitea-repositories-meta"), setting.RepoRootPath) |