mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-23 19:47:07 +09:00
Refactor some tests (#34580)
1. use `test.MockVariableValue` as much as possible 2. avoid `time.Sleep` as much as possible
This commit is contained in:
1 parent
c5e78fc7ad
commit
2a1585b32e
23 files changed
+58
-148
No files matched your search
@@ -11,7 +11,6 @@ import (
|
||||
"net/url"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
auth_model "code.gitea.io/gitea/models/auth"
|
||||
"code.gitea.io/gitea/models/repo"
|
||||
@@ -889,8 +888,7 @@ jobs:
|
||||
// 4. Execute a single Job
|
||||
task := runner.fetchTask(t)
|
||||
outcome := &mockTaskOutcome{
|
||||
result: runnerv1.Result_RESULT_SUCCESS,
|
||||
execTime: time.Millisecond,
|
||||
result: runnerv1.Result_RESULT_SUCCESS,
|
||||
}
|
||||
runner.execTask(t, task, outcome)
|
||||
|
||||
@@ -926,8 +924,7 @@ jobs:
|
||||
// 6. Execute a single Job
|
||||
task = runner.fetchTask(t)
|
||||
outcome = &mockTaskOutcome{
|
||||
result: runnerv1.Result_RESULT_FAILURE,
|
||||
execTime: time.Millisecond,
|
||||
result: runnerv1.Result_RESULT_FAILURE,
|
||||
}
|
||||
runner.execTask(t, task, outcome)
|
||||
|
||||
|
||||
Reference in new issue
Block a user