mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-19 16:30:15 +00:00
chore: improve slow tests
- Optimize generting random files. - Reduce big file of 128MiB to 32MiB (git was never made for large files anyways, but simply tests that it works). - Reduce looped git operations from 100 iterations to 10. - Add extra print statements to know what a slow test is doing, this also helps to see if a particular piece of code in a slow test is the culprit or if the test is just very extensive. - Set `[ui.notification].EVENT_SOURCE_UPDATE_TIME` to 1s to speed up `TestEventSourceManagerRun`. - Sneaked in some general test improvements.
This commit is contained in:
parent
9e95f80d94
commit
75a8b83946
13 changed files with 94 additions and 113 deletions
|
@ -15,6 +15,7 @@ import (
|
|||
repo_model "code.gitea.io/gitea/models/repo"
|
||||
"code.gitea.io/gitea/models/unittest"
|
||||
user_model "code.gitea.io/gitea/models/user"
|
||||
"code.gitea.io/gitea/tests"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
@ -67,6 +68,7 @@ func Test_CmdForgejo_Actions(t *testing.T) {
|
|||
},
|
||||
} {
|
||||
t.Run(testCase.testName, func(t *testing.T) {
|
||||
defer tests.PrintCurrentTest(t)()
|
||||
output, err := runMainApp("forgejo-cli", "actions", "register", "--secret", testCase.secret, "--scope", testCase.scope)
|
||||
assert.EqualValues(t, "", output)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue