1
0
Fork 0
forked from forgejo/forgejo

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>
This commit is contained in:
zeripath 2020-04-27 12:20:09 +01:00 committed by GitHub
parent 0e799c26ba
commit d26aee3830
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 11 deletions

View file

@ -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