Move almost all functions' parameter db.Engine to context.Context (#19748)
* Move almost all functions' parameter db.Engine to context.Context * remove some unnecessary wrap functions
This commit is contained in:
parent
d81e31ad78
commit
fd7d83ace6
232 changed files with 1463 additions and 2108 deletions
|
@ -40,7 +40,8 @@ func TestGiteaUploadRepo(t *testing.T) {
|
|||
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 1}).(*user_model.User)
|
||||
|
||||
var (
|
||||
downloader = NewGithubDownloaderV3(context.Background(), "https://github.com", "", "", "", "go-xorm", "builder")
|
||||
ctx = context.Background()
|
||||
downloader = NewGithubDownloaderV3(ctx, "https://github.com", "", "", "", "go-xorm", "builder")
|
||||
repoName = "builder-" + time.Now().Format("2006-01-02-15-04-05")
|
||||
uploader = NewGiteaLocalUploader(graceful.GetManager().HammerContext(), user, user.Name, repoName)
|
||||
)
|
||||
|
@ -80,7 +81,7 @@ func TestGiteaUploadRepo(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
assert.Empty(t, milestones)
|
||||
|
||||
labels, err := models.GetLabelsByRepoID(repo.ID, "", db.ListOptions{})
|
||||
labels, err := models.GetLabelsByRepoID(ctx, repo.ID, "", db.ListOptions{})
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, labels, 12)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue