summaryrefslogtreecommitdiffstats
path: root/integrations
diff options
context:
space:
mode:
Diffstat (limited to 'integrations')
-rw-r--r--integrations/api_comment_test.go4
-rw-r--r--integrations/api_issue_label_test.go4
-rw-r--r--integrations/api_issue_milestone_test.go2
-rw-r--r--integrations/api_issue_reaction_test.go16
-rw-r--r--integrations/api_notification_test.go6
-rw-r--r--integrations/api_pull_review_test.go2
-rw-r--r--integrations/api_repo_edit_test.go7
-rw-r--r--integrations/api_repo_file_create_test.go1
-rw-r--r--integrations/api_repo_file_delete_test.go3
-rw-r--r--integrations/api_repo_file_update_test.go1
-rw-r--r--integrations/api_repo_get_contents_list_test.go3
-rw-r--r--integrations/api_repo_get_contents_test.go3
-rw-r--r--integrations/api_repo_tags_test.go4
-rw-r--r--integrations/api_repo_teams_test.go12
-rw-r--r--integrations/api_repo_topic_test.go20
-rw-r--r--integrations/api_team_test.go2
-rw-r--r--integrations/api_user_orgs_test.go4
-rw-r--r--integrations/eventsource_test.go2
-rw-r--r--integrations/issue_test.go2
-rw-r--r--integrations/pull_status_test.go4
-rw-r--r--integrations/repo_fork_test.go4
-rw-r--r--integrations/repo_generate_test.go4
22 files changed, 52 insertions, 58 deletions
diff --git a/integrations/api_comment_test.go b/integrations/api_comment_test.go
index 6f8c5a85bd..cf26fa0e16 100644
--- a/integrations/api_comment_test.go
+++ b/integrations/api_comment_test.go
@@ -119,9 +119,9 @@ func TestAPIGetComment(t *testing.T) {
session := loginUser(t, repoOwner.Name)
token := getTokenForLoggedInUser(t, session)
req := NewRequestf(t, "GET", "/api/v1/repos/%s/%s/issues/comments/%d", repoOwner.Name, repo.Name, comment.ID)
- resp := session.MakeRequest(t, req, http.StatusOK)
+ session.MakeRequest(t, req, http.StatusOK)
req = NewRequestf(t, "GET", "/api/v1/repos/%s/%s/issues/comments/%d?token=%s", repoOwner.Name, repo.Name, comment.ID, token)
- resp = session.MakeRequest(t, req, http.StatusOK)
+ resp := session.MakeRequest(t, req, http.StatusOK)
var apiComment api.Comment
DecodeJSON(t, resp, &apiComment)
diff --git a/integrations/api_issue_label_test.go b/integrations/api_issue_label_test.go
index 58e09c818e..9e569c85a2 100644
--- a/integrations/api_issue_label_test.go
+++ b/integrations/api_issue_label_test.go
@@ -83,7 +83,7 @@ func TestAPIModifyLabels(t *testing.T) {
//DeleteLabel
req = NewRequest(t, "DELETE", singleURLStr)
- resp = session.MakeRequest(t, req, http.StatusNoContent)
+ session.MakeRequest(t, req, http.StatusNoContent)
}
@@ -203,6 +203,6 @@ func TestAPIModifyOrgLabels(t *testing.T) {
//DeleteLabel
req = NewRequest(t, "DELETE", singleURLStr)
- resp = session.MakeRequest(t, req, http.StatusNoContent)
+ session.MakeRequest(t, req, http.StatusNoContent)
}
diff --git a/integrations/api_issue_milestone_test.go b/integrations/api_issue_milestone_test.go
index 233d8ef33c..1ac3fb2ed8 100644
--- a/integrations/api_issue_milestone_test.go
+++ b/integrations/api_issue_milestone_test.go
@@ -74,5 +74,5 @@ func TestAPIIssuesMilestone(t *testing.T) {
assert.Equal(t, int64(2), apiMilestones[0].ID)
req = NewRequest(t, "DELETE", fmt.Sprintf("/api/v1/repos/%s/%s/milestones/%d?token=%s", owner.Name, repo.Name, apiMilestone.ID, token))
- resp = session.MakeRequest(t, req, http.StatusNoContent)
+ session.MakeRequest(t, req, http.StatusNoContent)
}
diff --git a/integrations/api_issue_reaction_test.go b/integrations/api_issue_reaction_test.go
index 4591f8fa8c..7b3632ca67 100644
--- a/integrations/api_issue_reaction_test.go
+++ b/integrations/api_issue_reaction_test.go
@@ -36,24 +36,24 @@ func TestAPIIssuesReactions(t *testing.T) {
req := NewRequestWithJSON(t, "POST", urlStr, &api.EditReactionOption{
Reaction: "wrong",
})
- resp := session.MakeRequest(t, req, http.StatusForbidden)
+ session.MakeRequest(t, req, http.StatusForbidden)
//Delete not allowed reaction
req = NewRequestWithJSON(t, "DELETE", urlStr, &api.EditReactionOption{
Reaction: "zzz",
})
- resp = session.MakeRequest(t, req, http.StatusOK)
+ session.MakeRequest(t, req, http.StatusOK)
//Add allowed reaction
req = NewRequestWithJSON(t, "POST", urlStr, &api.EditReactionOption{
Reaction: "rocket",
})
- resp = session.MakeRequest(t, req, http.StatusCreated)
+ resp := session.MakeRequest(t, req, http.StatusCreated)
var apiNewReaction api.Reaction
DecodeJSON(t, resp, &apiNewReaction)
//Add existing reaction
- resp = session.MakeRequest(t, req, http.StatusForbidden)
+ session.MakeRequest(t, req, http.StatusForbidden)
//Get end result of reaction list of issue #1
req = NewRequestf(t, "GET", urlStr)
@@ -96,24 +96,24 @@ func TestAPICommentReactions(t *testing.T) {
req := NewRequestWithJSON(t, "POST", urlStr, &api.EditReactionOption{
Reaction: "wrong",
})
- resp := session.MakeRequest(t, req, http.StatusForbidden)
+ session.MakeRequest(t, req, http.StatusForbidden)
//Delete none existing reaction
req = NewRequestWithJSON(t, "DELETE", urlStr, &api.EditReactionOption{
Reaction: "eyes",
})
- resp = session.MakeRequest(t, req, http.StatusOK)
+ session.MakeRequest(t, req, http.StatusOK)
//Add allowed reaction
req = NewRequestWithJSON(t, "POST", urlStr, &api.EditReactionOption{
Reaction: "+1",
})
- resp = session.MakeRequest(t, req, http.StatusCreated)
+ resp := session.MakeRequest(t, req, http.StatusCreated)
var apiNewReaction api.Reaction
DecodeJSON(t, resp, &apiNewReaction)
//Add existing reaction
- resp = session.MakeRequest(t, req, http.StatusForbidden)
+ session.MakeRequest(t, req, http.StatusForbidden)
//Get end result of reaction list of issue #1
req = NewRequestf(t, "GET", urlStr)
diff --git a/integrations/api_notification_test.go b/integrations/api_notification_test.go
index 1c62ee5abf..24d17173ac 100644
--- a/integrations/api_notification_test.go
+++ b/integrations/api_notification_test.go
@@ -66,7 +66,7 @@ func TestAPINotification(t *testing.T) {
// -- GET /notifications/threads/{id} --
// get forbidden
req = NewRequest(t, "GET", fmt.Sprintf("/api/v1/notifications/threads/%d?token=%s", 1, token))
- resp = session.MakeRequest(t, req, http.StatusForbidden)
+ session.MakeRequest(t, req, http.StatusForbidden)
// get own
req = NewRequest(t, "GET", fmt.Sprintf("/api/v1/notifications/threads/%d?token=%s", thread5.ID, token))
@@ -100,7 +100,7 @@ func TestAPINotification(t *testing.T) {
lastReadAt := "2000-01-01T00%3A50%3A01%2B00%3A00" //946687801 <- only Notification 4 is in this filter ...
req = NewRequest(t, "PUT", fmt.Sprintf("/api/v1/repos/%s/%s/notifications?last_read_at=%s&token=%s", user2.Name, repo1.Name, lastReadAt, token))
- resp = session.MakeRequest(t, req, http.StatusResetContent)
+ session.MakeRequest(t, req, http.StatusResetContent)
req = NewRequest(t, "GET", fmt.Sprintf("/api/v1/notifications?status-types=unread&token=%s", token))
resp = session.MakeRequest(t, req, http.StatusOK)
@@ -109,7 +109,7 @@ func TestAPINotification(t *testing.T) {
// -- PATCH /notifications/threads/{id} --
req = NewRequest(t, "PATCH", fmt.Sprintf("/api/v1/notifications/threads/%d?token=%s", thread5.ID, token))
- resp = session.MakeRequest(t, req, http.StatusResetContent)
+ session.MakeRequest(t, req, http.StatusResetContent)
assert.Equal(t, models.NotificationStatusUnread, thread5.Status)
thread5 = unittest.AssertExistsAndLoadBean(t, &models.Notification{ID: 5}).(*models.Notification)
diff --git a/integrations/api_pull_review_test.go b/integrations/api_pull_review_test.go
index ace2c89e80..50b9454084 100644
--- a/integrations/api_pull_review_test.go
+++ b/integrations/api_pull_review_test.go
@@ -140,7 +140,7 @@ func TestAPIPullReview(t *testing.T) {
assert.EqualValues(t, "COMMENT", review.State)
assert.EqualValues(t, 0, review.CodeCommentsCount)
req = NewRequestf(t, http.MethodDelete, "/api/v1/repos/%s/%s/pulls/%d/reviews/%d?token=%s", repo.OwnerName, repo.Name, pullIssue.Index, review.ID, token)
- resp = session.MakeRequest(t, req, http.StatusNoContent)
+ session.MakeRequest(t, req, http.StatusNoContent)
// test CreatePullReview Comment without body but with comments
req = NewRequestWithJSON(t, http.MethodPost, fmt.Sprintf("/api/v1/repos/%s/%s/pulls/%d/reviews?token=%s", repo.OwnerName, repo.Name, pullIssue.Index, token), &api.CreatePullReviewOptions{
diff --git a/integrations/api_repo_edit_test.go b/integrations/api_repo_edit_test.go
index 404e8e912f..f862afa2c3 100644
--- a/integrations/api_repo_edit_test.go
+++ b/integrations/api_repo_edit_test.go
@@ -145,7 +145,6 @@ func TestAPIRepoEdit(t *testing.T) {
// Get user2's token
session := loginUser(t, user2.Name)
token2 := getTokenForLoggedInUser(t, session)
- session = emptyTestSession(t)
// Get user4's token
session = loginUser(t, user4.Name)
token4 := getTokenForLoggedInUser(t, session)
@@ -223,15 +222,15 @@ func TestAPIRepoEdit(t *testing.T) {
// Do some tests with invalid URL for external tracker and wiki
repoEditOption.ExternalTracker.ExternalTrackerURL = "htp://www.somewebsite.com"
req = NewRequestWithJSON(t, "PATCH", url, &repoEditOption)
- resp = session.MakeRequest(t, req, http.StatusUnprocessableEntity)
+ session.MakeRequest(t, req, http.StatusUnprocessableEntity)
repoEditOption.ExternalTracker.ExternalTrackerURL = "http://www.somewebsite.com"
repoEditOption.ExternalTracker.ExternalTrackerFormat = "http://www.somewebsite.com/{user/{repo}?issue={index}"
req = NewRequestWithJSON(t, "PATCH", url, &repoEditOption)
- resp = session.MakeRequest(t, req, http.StatusUnprocessableEntity)
+ session.MakeRequest(t, req, http.StatusUnprocessableEntity)
repoEditOption.ExternalTracker.ExternalTrackerFormat = "http://www.somewebsite.com/{user}/{repo}?issue={index}"
repoEditOption.ExternalWiki.ExternalWikiURL = "htp://www.somewebsite.com"
req = NewRequestWithJSON(t, "PATCH", url, &repoEditOption)
- resp = session.MakeRequest(t, req, http.StatusUnprocessableEntity)
+ session.MakeRequest(t, req, http.StatusUnprocessableEntity)
//Test small repo change through API with issue and wiki option not set; They shall not be touched.
*repoEditOption.Description = "small change"
diff --git a/integrations/api_repo_file_create_test.go b/integrations/api_repo_file_create_test.go
index dd703a99bb..07ddbbbfe6 100644
--- a/integrations/api_repo_file_create_test.go
+++ b/integrations/api_repo_file_create_test.go
@@ -149,7 +149,6 @@ func TestAPICreateFile(t *testing.T) {
// Get user2's token
session := loginUser(t, user2.Name)
token2 := getTokenForLoggedInUser(t, session)
- session = emptyTestSession(t)
// Get user4's token
session = loginUser(t, user4.Name)
token4 := getTokenForLoggedInUser(t, session)
diff --git a/integrations/api_repo_file_delete_test.go b/integrations/api_repo_file_delete_test.go
index e9877d08c2..93da12700d 100644
--- a/integrations/api_repo_file_delete_test.go
+++ b/integrations/api_repo_file_delete_test.go
@@ -49,7 +49,6 @@ func TestAPIDeleteFile(t *testing.T) {
// Get user2's token
session := loginUser(t, user2.Name)
token2 := getTokenForLoggedInUser(t, session)
- session = emptyTestSession(t)
// Get user4's token
session = loginUser(t, user4.Name)
token4 := getTokenForLoggedInUser(t, session)
@@ -111,7 +110,7 @@ func TestAPIDeleteFile(t *testing.T) {
deleteFileOptions.SHA = "badsha"
url = fmt.Sprintf("/api/v1/repos/%s/%s/contents/%s?token=%s", user2.Name, repo1.Name, treePath, token2)
req = NewRequestWithJSON(t, "DELETE", url, &deleteFileOptions)
- resp = session.MakeRequest(t, req, http.StatusBadRequest)
+ session.MakeRequest(t, req, http.StatusBadRequest)
// Test creating a file in repo16 by user4 who does not have write access
fileID++
diff --git a/integrations/api_repo_file_update_test.go b/integrations/api_repo_file_update_test.go
index ba1f309f14..fb554efe7a 100644
--- a/integrations/api_repo_file_update_test.go
+++ b/integrations/api_repo_file_update_test.go
@@ -115,7 +115,6 @@ func TestAPIUpdateFile(t *testing.T) {
// Get user2's token
session := loginUser(t, user2.Name)
token2 := getTokenForLoggedInUser(t, session)
- session = emptyTestSession(t)
// Get user4's token
session = loginUser(t, user4.Name)
token4 := getTokenForLoggedInUser(t, session)
diff --git a/integrations/api_repo_get_contents_list_test.go b/integrations/api_repo_get_contents_list_test.go
index 823a72c726..abcfc1fd82 100644
--- a/integrations/api_repo_get_contents_list_test.go
+++ b/integrations/api_repo_get_contents_list_test.go
@@ -64,7 +64,6 @@ func testAPIGetContentsList(t *testing.T, u *url.URL) {
// Get user2's token
session := loginUser(t, user2.Name)
token2 := getTokenForLoggedInUser(t, session)
- session = emptyTestSession(t)
// Get user4's token
session = loginUser(t, user4.Name)
token4 := getTokenForLoggedInUser(t, session)
@@ -139,7 +138,7 @@ func testAPIGetContentsList(t *testing.T, u *url.URL) {
// Test file contents a file with a bad ref
ref = "badref"
req = NewRequestf(t, "GET", "/api/v1/repos/%s/%s/contents/%s?ref=%s", user2.Name, repo1.Name, treePath, ref)
- resp = session.MakeRequest(t, req, http.StatusNotFound)
+ session.MakeRequest(t, req, http.StatusNotFound)
// Test accessing private ref with user token that does not have access - should fail
req = NewRequestf(t, "GET", "/api/v1/repos/%s/%s/contents/%s?token=%s", user2.Name, repo16.Name, treePath, token4)
diff --git a/integrations/api_repo_get_contents_test.go b/integrations/api_repo_get_contents_test.go
index 67ec02b7b0..00fef78b88 100644
--- a/integrations/api_repo_get_contents_test.go
+++ b/integrations/api_repo_get_contents_test.go
@@ -65,7 +65,6 @@ func testAPIGetContents(t *testing.T, u *url.URL) {
// Get user2's token
session := loginUser(t, user2.Name)
token2 := getTokenForLoggedInUser(t, session)
- session = emptyTestSession(t)
// Get user4's token
session = loginUser(t, user4.Name)
token4 := getTokenForLoggedInUser(t, session)
@@ -141,7 +140,7 @@ func testAPIGetContents(t *testing.T, u *url.URL) {
// Test file contents a file with a bad ref
ref = "badref"
req = NewRequestf(t, "GET", "/api/v1/repos/%s/%s/contents/%s?ref=%s", user2.Name, repo1.Name, treePath, ref)
- resp = session.MakeRequest(t, req, http.StatusNotFound)
+ session.MakeRequest(t, req, http.StatusNotFound)
// Test accessing private ref with user token that does not have access - should fail
req = NewRequestf(t, "GET", "/api/v1/repos/%s/%s/contents/%s?token=%s", user2.Name, repo16.Name, treePath, token4)
diff --git a/integrations/api_repo_tags_test.go b/integrations/api_repo_tags_test.go
index 59eaedcbdf..79a2880bcf 100644
--- a/integrations/api_repo_tags_test.go
+++ b/integrations/api_repo_tags_test.go
@@ -62,10 +62,10 @@ func TestAPIRepoTags(t *testing.T) {
// delete tag
delReq := NewRequestf(t, "DELETE", "/api/v1/repos/%s/%s/tags/%s?token=%s", user.Name, repoName, newTag.Name, token)
- resp = session.MakeRequest(t, delReq, http.StatusNoContent)
+ session.MakeRequest(t, delReq, http.StatusNoContent)
// check if it's gone
- resp = session.MakeRequest(t, req, http.StatusNotFound)
+ session.MakeRequest(t, req, http.StatusNotFound)
}
func createNewTagUsingAPI(t *testing.T, session *TestSession, token string, ownerName, repoName, name, target, msg string) *api.Tag {
diff --git a/integrations/api_repo_teams_test.go b/integrations/api_repo_teams_test.go
index 56836fcee3..59025e0e53 100644
--- a/integrations/api_repo_teams_test.go
+++ b/integrations/api_repo_teams_test.go
@@ -54,12 +54,12 @@ func TestAPIRepoTeams(t *testing.T) {
url = fmt.Sprintf("/api/v1/repos/%s/teams/%s?token=%s", publicOrgRepo.FullName(), "NonExistingTeam", token)
req = NewRequest(t, "GET", url)
- res = session.MakeRequest(t, req, http.StatusNotFound)
+ session.MakeRequest(t, req, http.StatusNotFound)
// AddTeam with user4
url = fmt.Sprintf("/api/v1/repos/%s/teams/%s?token=%s", publicOrgRepo.FullName(), "team1", token)
req = NewRequest(t, "PUT", url)
- res = session.MakeRequest(t, req, http.StatusForbidden)
+ session.MakeRequest(t, req, http.StatusForbidden)
// AddTeam with user2
user = unittest.AssertExistsAndLoadBean(t, &models.User{ID: 2}).(*models.User)
@@ -67,12 +67,12 @@ func TestAPIRepoTeams(t *testing.T) {
token = getTokenForLoggedInUser(t, session)
url = fmt.Sprintf("/api/v1/repos/%s/teams/%s?token=%s", publicOrgRepo.FullName(), "team1", token)
req = NewRequest(t, "PUT", url)
- res = session.MakeRequest(t, req, http.StatusNoContent)
- res = session.MakeRequest(t, req, http.StatusUnprocessableEntity) // test duplicate request
+ session.MakeRequest(t, req, http.StatusNoContent)
+ session.MakeRequest(t, req, http.StatusUnprocessableEntity) // test duplicate request
// DeleteTeam
url = fmt.Sprintf("/api/v1/repos/%s/teams/%s?token=%s", publicOrgRepo.FullName(), "team1", token)
req = NewRequest(t, "DELETE", url)
- res = session.MakeRequest(t, req, http.StatusNoContent)
- res = session.MakeRequest(t, req, http.StatusUnprocessableEntity) // test duplicate request
+ session.MakeRequest(t, req, http.StatusNoContent)
+ session.MakeRequest(t, req, http.StatusUnprocessableEntity) // test duplicate request
}
diff --git a/integrations/api_repo_topic_test.go b/integrations/api_repo_topic_test.go
index 6035dd3d52..05f025d946 100644
--- a/integrations/api_repo_topic_test.go
+++ b/integrations/api_repo_topic_test.go
@@ -75,15 +75,15 @@ func TestAPIRepoTopic(t *testing.T) {
// Test delete a topic
req = NewRequestf(t, "DELETE", "/api/v1/repos/%s/%s/topics/%s?token=%s", user2.Name, repo2.Name, "Topicname1", token2)
- res = session.MakeRequest(t, req, http.StatusNoContent)
+ session.MakeRequest(t, req, http.StatusNoContent)
// Test add an existing topic
req = NewRequestf(t, "PUT", "/api/v1/repos/%s/%s/topics/%s?token=%s", user2.Name, repo2.Name, "Golang", token2)
- res = session.MakeRequest(t, req, http.StatusNoContent)
+ session.MakeRequest(t, req, http.StatusNoContent)
// Test add a topic
req = NewRequestf(t, "PUT", "/api/v1/repos/%s/%s/topics/%s?token=%s", user2.Name, repo2.Name, "topicName3", token2)
- res = session.MakeRequest(t, req, http.StatusNoContent)
+ session.MakeRequest(t, req, http.StatusNoContent)
// Test read topics using token
req = NewRequest(t, "GET", url)
@@ -96,7 +96,7 @@ func TestAPIRepoTopic(t *testing.T) {
req = NewRequestWithJSON(t, "PUT", url, &api.RepoTopicOptions{
Topics: newTopics,
})
- res = session.MakeRequest(t, req, http.StatusNoContent)
+ session.MakeRequest(t, req, http.StatusNoContent)
req = NewRequest(t, "GET", url)
res = session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, res, &topics)
@@ -107,7 +107,7 @@ func TestAPIRepoTopic(t *testing.T) {
req = NewRequestWithJSON(t, "PUT", url, &api.RepoTopicOptions{
Topics: newTopics,
})
- res = session.MakeRequest(t, req, http.StatusUnprocessableEntity)
+ session.MakeRequest(t, req, http.StatusUnprocessableEntity)
req = NewRequest(t, "GET", url)
res = session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, res, &topics)
@@ -118,7 +118,7 @@ func TestAPIRepoTopic(t *testing.T) {
req = NewRequestWithJSON(t, "PUT", url, &api.RepoTopicOptions{
Topics: newTopics,
})
- res = session.MakeRequest(t, req, http.StatusNoContent)
+ session.MakeRequest(t, req, http.StatusNoContent)
req = NewRequest(t, "GET", url)
res = session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, res, &topics)
@@ -129,15 +129,15 @@ func TestAPIRepoTopic(t *testing.T) {
req = NewRequestWithJSON(t, "PUT", url, &api.RepoTopicOptions{
Topics: newTopics,
})
- res = session.MakeRequest(t, req, http.StatusUnprocessableEntity)
+ session.MakeRequest(t, req, http.StatusUnprocessableEntity)
// Test add a topic when there is already maximum
req = NewRequestf(t, "PUT", "/api/v1/repos/%s/%s/topics/%s?token=%s", user2.Name, repo2.Name, "t26", token2)
- res = session.MakeRequest(t, req, http.StatusUnprocessableEntity)
+ session.MakeRequest(t, req, http.StatusUnprocessableEntity)
// Test delete a topic that repo doesn't have
req = NewRequestf(t, "DELETE", "/api/v1/repos/%s/%s/topics/%s?token=%s", user2.Name, repo2.Name, "Topicname1", token2)
- res = session.MakeRequest(t, req, http.StatusNotFound)
+ session.MakeRequest(t, req, http.StatusNotFound)
// Get user4's token
session = loginUser(t, user4.Name)
@@ -153,6 +153,6 @@ func TestAPIRepoTopic(t *testing.T) {
// Test add a topic to repo with write access (requires repo admin access)
req = NewRequestf(t, "PUT", "/api/v1/repos/%s/%s/topics/%s?token=%s", user3.Name, repo3.Name, "topicName", token4)
- res = session.MakeRequest(t, req, http.StatusForbidden)
+ session.MakeRequest(t, req, http.StatusForbidden)
}
diff --git a/integrations/api_team_test.go b/integrations/api_team_test.go
index 141c887e13..26d6c884b4 100644
--- a/integrations/api_team_test.go
+++ b/integrations/api_team_test.go
@@ -160,6 +160,6 @@ func TestAPITeamSearch(t *testing.T) {
csrf = GetCSRF(t, session, "/"+org.Name)
req = NewRequestf(t, "GET", "/api/v1/orgs/%s/teams/search?q=%s", org.Name, "team")
req.Header.Add("X-Csrf-Token", csrf)
- resp = session.MakeRequest(t, req, http.StatusForbidden)
+ session.MakeRequest(t, req, http.StatusForbidden)
}
diff --git a/integrations/api_user_orgs_test.go b/integrations/api_user_orgs_test.go
index d52ac980b9..5bc5df118f 100644
--- a/integrations/api_user_orgs_test.go
+++ b/integrations/api_user_orgs_test.go
@@ -72,13 +72,13 @@ func TestMyOrgs(t *testing.T) {
session := emptyTestSession(t)
req := NewRequest(t, "GET", "/api/v1/user/orgs")
- resp := session.MakeRequest(t, req, http.StatusUnauthorized)
+ session.MakeRequest(t, req, http.StatusUnauthorized)
normalUsername := "user2"
session = loginUser(t, normalUsername)
token := getTokenForLoggedInUser(t, session)
req = NewRequest(t, "GET", "/api/v1/user/orgs?token="+token)
- resp = session.MakeRequest(t, req, http.StatusOK)
+ resp := session.MakeRequest(t, req, http.StatusOK)
var orgs []*api.Organization
DecodeJSON(t, resp, &orgs)
user3 := unittest.AssertExistsAndLoadBean(t, &models.User{Name: "user3"}).(*models.User)
diff --git a/integrations/eventsource_test.go b/integrations/eventsource_test.go
index eb08c004a8..6c4c87b3d1 100644
--- a/integrations/eventsource_test.go
+++ b/integrations/eventsource_test.go
@@ -69,7 +69,7 @@ func TestEventSourceManagerRun(t *testing.T) {
lastReadAt := "2000-01-01T00%3A50%3A01%2B00%3A00" //946687801 <- only Notification 4 is in this filter ...
req = NewRequest(t, "PUT", fmt.Sprintf("/api/v1/repos/%s/%s/notifications?last_read_at=%s&token=%s", user2.Name, repo1.Name, lastReadAt, token))
- resp = session.MakeRequest(t, req, http.StatusResetContent)
+ session.MakeRequest(t, req, http.StatusResetContent)
req = NewRequest(t, "GET", fmt.Sprintf("/api/v1/notifications?token=%s&status-types=unread", token))
resp = session.MakeRequest(t, req, http.StatusOK)
diff --git a/integrations/issue_test.go b/integrations/issue_test.go
index 56cddcb063..ae274749a2 100644
--- a/integrations/issue_test.go
+++ b/integrations/issue_test.go
@@ -287,7 +287,7 @@ func TestIssueCrossReference(t *testing.T) {
unittest.AssertExistsAndLoadBean(t, comment)
// Ref from a different repository
- issueRefURL, issueRef = testIssueWithBean(t, "user12", 10, "TitleXRef", fmt.Sprintf("Description ref user2/repo1#%d", issueBase.Index))
+ _, issueRef = testIssueWithBean(t, "user12", 10, "TitleXRef", fmt.Sprintf("Description ref user2/repo1#%d", issueBase.Index))
unittest.AssertExistsAndLoadBean(t, &models.Comment{
IssueID: issueBase.ID,
RefRepoID: 10,
diff --git a/integrations/pull_status_test.go b/integrations/pull_status_test.go
index 7c6f3d44c5..f818643005 100644
--- a/integrations/pull_status_test.go
+++ b/integrations/pull_status_test.go
@@ -33,12 +33,12 @@ func TestPullCreate_CommitStatus(t *testing.T) {
req = NewRequest(t, "GET", "/user1/repo1/pulls")
resp := session.MakeRequest(t, req, http.StatusOK)
- doc := NewHTMLParser(t, resp.Body)
+ NewHTMLParser(t, resp.Body)
// Request repository commits page
req = NewRequest(t, "GET", "/user1/repo1/pulls/1/commits")
resp = session.MakeRequest(t, req, http.StatusOK)
- doc = NewHTMLParser(t, resp.Body)
+ doc := NewHTMLParser(t, resp.Body)
// Get first commit URL
commitURL, exists := doc.doc.Find("#commits-table tbody tr td.sha a").Last().Attr("href")
diff --git a/integrations/repo_fork_test.go b/integrations/repo_fork_test.go
index 22b2169e2f..0f23aa5e87 100644
--- a/integrations/repo_fork_test.go
+++ b/integrations/repo_fork_test.go
@@ -21,11 +21,11 @@ func testRepoFork(t *testing.T, session *TestSession, ownerName, repoName, forkO
// Step0: check the existence of the to-fork repo
req := NewRequestf(t, "GET", "/%s/%s", forkOwnerName, forkRepoName)
- resp := session.MakeRequest(t, req, http.StatusNotFound)
+ session.MakeRequest(t, req, http.StatusNotFound)
// Step1: go to the main page of repo
req = NewRequestf(t, "GET", "/%s/%s", ownerName, repoName)
- resp = session.MakeRequest(t, req, http.StatusOK)
+ resp := session.MakeRequest(t, req, http.StatusOK)
// Step2: click the fork button
htmlDoc := NewHTMLParser(t, resp.Body)
diff --git a/integrations/repo_generate_test.go b/integrations/repo_generate_test.go
index d1e28c2f08..66819656f9 100644
--- a/integrations/repo_generate_test.go
+++ b/integrations/repo_generate_test.go
@@ -21,11 +21,11 @@ func testRepoGenerate(t *testing.T, session *TestSession, templateOwnerName, tem
// Step0: check the existence of the generated repo
req := NewRequestf(t, "GET", "/%s/%s", generateOwnerName, generateRepoName)
- resp := session.MakeRequest(t, req, http.StatusNotFound)
+ session.MakeRequest(t, req, http.StatusNotFound)
// Step1: go to the main page of template repo
req = NewRequestf(t, "GET", "/%s/%s", templateOwnerName, templateRepoName)
- resp = session.MakeRequest(t, req, http.StatusOK)
+ resp := session.MakeRequest(t, req, http.StatusOK)
// Step2: click the "Use this template" button
htmlDoc := NewHTMLParser(t, resp.Body)