Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org> Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
This commit is contained in:
committed by
forgejo-renovate-action
parent
51ff4970ec
commit
fed2d81c44
@@ -48,9 +48,9 @@ func TestDeleteComment(t *testing.T) {
|
||||
// Reactions don't exist anymore for this comment.
|
||||
unittest.AssertNotExistsBean(t, &issues_model.Reaction{CommentID: comment.ID})
|
||||
// Number of comments was decreased.
|
||||
assert.EqualValues(t, issue.NumComments-1, unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: comment.IssueID}).NumComments)
|
||||
assert.Equal(t, issue.NumComments-1, unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: comment.IssueID}).NumComments)
|
||||
// A notification was fired for the deletion of this comment.
|
||||
assert.EqualValues(t, hookTaskCount+1, unittest.GetCount(t, &webhook_model.HookTask{}))
|
||||
assert.Equal(t, hookTaskCount+1, unittest.GetCount(t, &webhook_model.HookTask{}))
|
||||
})
|
||||
|
||||
t.Run("Comment of pending review", func(t *testing.T) {
|
||||
@@ -59,7 +59,7 @@ func TestDeleteComment(t *testing.T) {
|
||||
// We have to ensure that this comment's linked review is pending.
|
||||
comment := unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ID: 4}, "review_id != 0")
|
||||
review := unittest.AssertExistsAndLoadBean(t, &issues_model.Review{ID: comment.ReviewID})
|
||||
assert.EqualValues(t, issues_model.ReviewTypePending, review.Type)
|
||||
assert.Equal(t, issues_model.ReviewTypePending, review.Type)
|
||||
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: comment.IssueID})
|
||||
|
||||
require.NoError(t, webhook_model.CreateWebhook(db.DefaultContext, &webhook_model.Webhook{
|
||||
@@ -74,9 +74,9 @@ func TestDeleteComment(t *testing.T) {
|
||||
// The comment doesn't exist anymore.
|
||||
unittest.AssertNotExistsBean(t, &issues_model.Comment{ID: comment.ID})
|
||||
// Ensure that the number of comments wasn't decreased.
|
||||
assert.EqualValues(t, issue.NumComments, unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: comment.IssueID}).NumComments)
|
||||
assert.Equal(t, issue.NumComments, unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: comment.IssueID}).NumComments)
|
||||
// No notification was fired for the deletion of this comment.
|
||||
assert.EqualValues(t, hookTaskCount, unittest.GetCount(t, &webhook_model.HookTask{}))
|
||||
assert.Equal(t, hookTaskCount, unittest.GetCount(t, &webhook_model.HookTask{}))
|
||||
})
|
||||
}
|
||||
|
||||
@@ -105,11 +105,11 @@ func TestUpdateComment(t *testing.T) {
|
||||
|
||||
newComment := unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ID: 2})
|
||||
// Content was updated.
|
||||
assert.EqualValues(t, comment.Content, newComment.Content)
|
||||
assert.Equal(t, comment.Content, newComment.Content)
|
||||
// Content version was updated.
|
||||
assert.EqualValues(t, 2, newComment.ContentVersion)
|
||||
assert.Equal(t, 2, newComment.ContentVersion)
|
||||
// A notification was fired for the update of this comment.
|
||||
assert.EqualValues(t, hookTaskCount+1, unittest.GetCount(t, &webhook_model.HookTask{}))
|
||||
assert.Equal(t, hookTaskCount+1, unittest.GetCount(t, &webhook_model.HookTask{}))
|
||||
// Issue history was saved for this comment.
|
||||
unittest.AssertExistsAndLoadBean(t, &issues_model.ContentHistory{CommentID: comment.ID, IsFirstCreated: true, ContentText: oldContent})
|
||||
unittest.AssertExistsAndLoadBean(t, &issues_model.ContentHistory{CommentID: comment.ID, ContentText: comment.Content}, "is_first_created = false")
|
||||
@@ -120,7 +120,7 @@ func TestUpdateComment(t *testing.T) {
|
||||
|
||||
comment := unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ID: 4}, "review_id != 0")
|
||||
review := unittest.AssertExistsAndLoadBean(t, &issues_model.Review{ID: comment.ReviewID})
|
||||
assert.EqualValues(t, issues_model.ReviewTypePending, review.Type)
|
||||
assert.Equal(t, issues_model.ReviewTypePending, review.Type)
|
||||
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: comment.IssueID})
|
||||
unittest.AssertNotExistsBean(t, &issues_model.ContentHistory{CommentID: comment.ID})
|
||||
require.NoError(t, webhook_model.CreateWebhook(db.DefaultContext, &webhook_model.Webhook{
|
||||
@@ -136,11 +136,11 @@ func TestUpdateComment(t *testing.T) {
|
||||
|
||||
newComment := unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ID: 2})
|
||||
// Content was updated.
|
||||
assert.EqualValues(t, comment.Content, newComment.Content)
|
||||
assert.Equal(t, comment.Content, newComment.Content)
|
||||
// Content version was updated.
|
||||
assert.EqualValues(t, 2, newComment.ContentVersion)
|
||||
assert.Equal(t, 2, newComment.ContentVersion)
|
||||
// No notification was fired for the update of this comment.
|
||||
assert.EqualValues(t, hookTaskCount, unittest.GetCount(t, &webhook_model.HookTask{}))
|
||||
assert.Equal(t, hookTaskCount, unittest.GetCount(t, &webhook_model.HookTask{}))
|
||||
// Issue history was not saved for this comment.
|
||||
unittest.AssertNotExistsBean(t, &issues_model.ContentHistory{CommentID: comment.ID})
|
||||
})
|
||||
|
||||
@@ -25,8 +25,8 @@ func TestGetRefEndNamesAndURLs(t *testing.T) {
|
||||
repoLink := "/foo/bar"
|
||||
|
||||
endNames, urls := GetRefEndNamesAndURLs(issues, repoLink)
|
||||
assert.EqualValues(t, map[int64]string{1: "branch1", 2: "tag1", 3: "c0ffee"}, endNames)
|
||||
assert.EqualValues(t, map[int64]string{
|
||||
assert.Equal(t, map[int64]string{1: "branch1", 2: "tag1", 3: "c0ffee"}, endNames)
|
||||
assert.Equal(t, map[int64]string{
|
||||
1: repoLink + "/src/branch/branch1",
|
||||
2: repoLink + "/src/tag/tag1",
|
||||
3: repoLink + "/src/commit/c0ffee",
|
||||
|
||||
Reference in New Issue
Block a user