diff options
author | 6543 <6543@obermui.de> | 2022-05-02 01:54:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-02 01:54:44 +0200 |
commit | d8905cb623cf55194eec5f1ed97fdc7bb30ff1cb (patch) | |
tree | 0027fccb3c7ffe4bc5b5144998d08320c41fa3e4 /services/pull/check_test.go | |
parent | 3725fa28ccc01ab08060f591f894ea6443a348e8 (diff) | |
download | gitea-d8905cb623cf55194eec5f1ed97fdc7bb30ff1cb.tar.gz gitea-d8905cb623cf55194eec5f1ed97fdc7bb30ff1cb.zip |
Dont overwrite err with nil & rename PullCheckingFuncs to reflect there usage (#19572)
- dont overwrite err with nil unintentionaly
- rename CheckPRReadyToMerge to CheckPullBranchProtections
- rename prQueue to prPatchCheckerQueue
from #9307
Co-authored-by: delvh <dev.lh@web.de>
Diffstat (limited to 'services/pull/check_test.go')
-rw-r--r-- | services/pull/check_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/services/pull/check_test.go b/services/pull/check_test.go index 65bcb9c0e4..bc4c45ffad 100644 --- a/services/pull/check_test.go +++ b/services/pull/check_test.go @@ -41,7 +41,7 @@ func TestPullRequest_AddToTaskQueue(t *testing.T) { queueShutdown := []func(){} queueTerminate := []func(){} - prQueue = q.(queue.UniqueQueue) + prPatchCheckerQueue = q.(queue.UniqueQueue) pr := unittest.AssertExistsAndLoadBean(t, &models.PullRequest{ID: 2}).(*models.PullRequest) AddToTaskQueue(pr) @@ -51,11 +51,11 @@ func TestPullRequest_AddToTaskQueue(t *testing.T) { return pr.Status == models.PullRequestStatusChecking }, 1*time.Second, 100*time.Millisecond) - has, err := prQueue.Has(strconv.FormatInt(pr.ID, 10)) + has, err := prPatchCheckerQueue.Has(strconv.FormatInt(pr.ID, 10)) assert.True(t, has) assert.NoError(t, err) - prQueue.Run(func(shutdown func()) { + prPatchCheckerQueue.Run(func(shutdown func()) { queueShutdown = append(queueShutdown, shutdown) }, func(terminate func()) { queueTerminate = append(queueTerminate, terminate) @@ -68,7 +68,7 @@ func TestPullRequest_AddToTaskQueue(t *testing.T) { assert.Fail(t, "Timeout: nothing was added to pullRequestQueue") } - has, err = prQueue.Has(strconv.FormatInt(pr.ID, 10)) + has, err = prPatchCheckerQueue.Has(strconv.FormatInt(pr.ID, 10)) assert.False(t, has) assert.NoError(t, err) @@ -82,5 +82,5 @@ func TestPullRequest_AddToTaskQueue(t *testing.T) { callback() } - prQueue = nil + prPatchCheckerQueue = nil } |