summaryrefslogtreecommitdiffstats
path: root/integrations/api_branch_test.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-04-27 12:20:09 +0100
committerGitHub <noreply@github.com>2020-04-27 14:20:09 +0300
commitd26aee38307b84d6e3001fd7e531a0d67a804267 (patch)
treeabd5d24534ac8eaea206032ba531b65fa4645228 /integrations/api_branch_test.go
parent0e799c26ba322e8e1dd1e5acd1367341c0452987 (diff)
downloadgitea-d26aee38307b84d6e3001fd7e531a0d67a804267.tar.gz
gitea-d26aee38307b84d6e3001fd7e531a0d67a804267.zip
Slight performance changes to integrations/git_test.go (#11227)
* switch to use pseudorandom generator and stop cloning in pushcreate Signed-off-by: Andrew Thornton <art27@cantab.net> * Add some logging of BranchProtectPRMerge Signed-off-by: Andrew Thornton <art27@cantab.net> * Stop running prepareTestEnv so often for TestAPIGetBranch Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'integrations/api_branch_test.go')
-rw-r--r--integrations/api_branch_test.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/integrations/api_branch_test.go b/integrations/api_branch_test.go
index 8417ab36c5..acf7525f80 100644
--- a/integrations/api_branch_test.go
+++ b/integrations/api_branch_test.go
@@ -14,8 +14,6 @@ import (
)
func testAPIGetBranch(t *testing.T, branchName string, exists bool) {
- defer prepareTestEnv(t)()
-
session := loginUser(t, "user2")
token := getTokenForLoggedInUser(t, session)
req := NewRequestf(t, "GET", "/api/v1/repos/user2/repo1/branches/%s?token=%s", branchName, token)
@@ -88,6 +86,7 @@ func testAPIDeleteBranch(t *testing.T, branchName string, expectedHTTPStatus int
}
func TestAPIGetBranch(t *testing.T) {
+ defer prepareTestEnv(t)()
for _, test := range []struct {
BranchName string
Exists bool