summaryrefslogtreecommitdiffstats
path: root/tests/integration/api_repo_file_create_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/api_repo_file_create_test.go')
-rw-r--r--tests/integration/api_repo_file_create_test.go19
1 files changed, 9 insertions, 10 deletions
diff --git a/tests/integration/api_repo_file_create_test.go b/tests/integration/api_repo_file_create_test.go
index 2433a68c31..c48abe7f0f 100644
--- a/tests/integration/api_repo_file_create_test.go
+++ b/tests/integration/api_repo_file_create_test.go
@@ -110,14 +110,14 @@ func getExpectedFileResponseForCreate(repoFullName, commitID, treePath, latestCo
}
func BenchmarkAPICreateFileSmall(b *testing.B) {
- onGiteaRunTB(b, func(t testing.TB, u *url.URL) {
- b := t.(*testing.B)
- user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) // owner of the repo1 & repo16
- repo1 := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1}) // public repo
+ onGiteaRun(b, func(b *testing.B, u *url.URL) {
+ user2 := unittest.AssertExistsAndLoadBean(b, &user_model.User{ID: 2}) // owner of the repo1 & repo16
+ repo1 := unittest.AssertExistsAndLoadBean(b, &repo_model.Repository{ID: 1}) // public repo
+ b.ResetTimer()
for n := 0; n < b.N; n++ {
treePath := fmt.Sprintf("update/file%d.txt", n)
- createFileInBranch(user2, repo1, treePath, repo1.DefaultBranch, treePath)
+ _, _ = createFileInBranch(user2, repo1, treePath, repo1.DefaultBranch, treePath)
}
})
}
@@ -125,16 +125,15 @@ func BenchmarkAPICreateFileSmall(b *testing.B) {
func BenchmarkAPICreateFileMedium(b *testing.B) {
data := make([]byte, 10*1024*1024)
- onGiteaRunTB(b, func(t testing.TB, u *url.URL) {
- b := t.(*testing.B)
- user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) // owner of the repo1 & repo16
- repo1 := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1}) // public repo
+ onGiteaRun(b, func(b *testing.B, u *url.URL) {
+ user2 := unittest.AssertExistsAndLoadBean(b, &user_model.User{ID: 2}) // owner of the repo1 & repo16
+ repo1 := unittest.AssertExistsAndLoadBean(b, &repo_model.Repository{ID: 1}) // public repo
b.ResetTimer()
for n := 0; n < b.N; n++ {
treePath := fmt.Sprintf("update/file%d.txt", n)
copy(data, treePath)
- createFileInBranch(user2, repo1, treePath, repo1.DefaultBranch, treePath)
+ _, _ = createFileInBranch(user2, repo1, treePath, repo1.DefaultBranch, treePath)
}
})
}